<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><link rel="stylesheet" type="text/css" href="style.css" /><script type="text/javascript" src="highlight.js"></script></head><body><pre><span class="hs-pragma">{-# LANGUAGE GADTs, DisambiguateRecordFields, BangPatterns #-}</span><span>
</span><span id="line-2"></span><span class="hs-pragma">{-# OPTIONS_GHC -Wno-incomplete-record-updates #-}</span><span>
</span><span id="line-3"></span><span>
</span><span id="line-4"></span><span class="hs-keyword">module</span><span> </span><span class="hs-identifier">GHC.Cmm.ProcPoint</span><span>
</span><span id="line-5"></span><span>    </span><span class="hs-special">(</span><span> </span><span class="annot"><a href="GHC.Cmm.ProcPoint.html#ProcPointSet"><span class="hs-identifier">ProcPointSet</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Cmm.ProcPoint.html#Status"><span class="hs-identifier">Status</span></a></span><span class="hs-special">(</span><span class="hs-glyph">..</span><span class="hs-special">)</span><span>
</span><span id="line-6"></span><span>    </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Cmm.ProcPoint.html#callProcPoints"><span class="hs-identifier">callProcPoints</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Cmm.ProcPoint.html#minimalProcPointSet"><span class="hs-identifier">minimalProcPointSet</span></a></span><span>
</span><span id="line-7"></span><span>    </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Cmm.ProcPoint.html#splitAtProcPoints"><span class="hs-identifier">splitAtProcPoints</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Cmm.ProcPoint.html#procPointAnalysis"><span class="hs-identifier">procPointAnalysis</span></a></span><span>
</span><span id="line-8"></span><span>    </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Cmm.ProcPoint.html#attachContInfoTables"><span class="hs-identifier">attachContInfoTables</span></a></span><span>
</span><span id="line-9"></span><span>    </span><span class="hs-special">)</span><span>
</span><span id="line-10"></span><span class="hs-keyword">where</span><span>
</span><span id="line-11"></span><span>
</span><span id="line-12"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Prelude.html"><span class="hs-identifier">GHC.Prelude</span></a></span><span> </span><span class="hs-keyword">hiding</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../base/src/GHC.List.html#last"><span class="hs-identifier">last</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="../../base/src/GHC.List.html#unzip"><span class="hs-identifier">unzip</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="../../base/src/GHC.Enum.html#succ"><span class="hs-identifier">succ</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="../../base/src/GHC.List.html#zip"><span class="hs-identifier">zip</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-13"></span><span>
</span><span id="line-14"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Driver.Session.html"><span class="hs-identifier">GHC.Driver.Session</span></a></span><span>
</span><span id="line-15"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Cmm.BlockId.html"><span class="hs-identifier">GHC.Cmm.BlockId</span></a></span><span>
</span><span id="line-16"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Cmm.CLabel.html"><span class="hs-identifier">GHC.Cmm.CLabel</span></a></span><span>
</span><span id="line-17"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Cmm.html"><span class="hs-identifier">GHC.Cmm</span></a></span><span>
</span><span id="line-18"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Cmm.Ppr.html"><span class="hs-identifier">GHC.Cmm.Ppr</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span><span> </span><span class="hs-comment">-- For Outputable instances</span><span>
</span><span id="line-19"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Cmm.Utils.html"><span class="hs-identifier">GHC.Cmm.Utils</span></a></span><span>
</span><span id="line-20"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Cmm.Info.html"><span class="hs-identifier">GHC.Cmm.Info</span></a></span><span>
</span><span id="line-21"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Cmm.Liveness.html"><span class="hs-identifier">GHC.Cmm.Liveness</span></a></span><span>
</span><span id="line-22"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Cmm.Switch.html"><span class="hs-identifier">GHC.Cmm.Switch</span></a></span><span>
</span><span id="line-23"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="../../base/src/Data.List.html#"><span class="hs-identifier">Data.List</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../base/src/Data.OldList.html#sortBy"><span class="hs-identifier">sortBy</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-24"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Data.Maybe.html"><span class="hs-identifier">GHC.Data.Maybe</span></a></span><span>
</span><span id="line-25"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="../../base/src/Control.Monad.html#"><span class="hs-identifier">Control.Monad</span></a></span><span>
</span><span id="line-26"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Utils.Outputable.html"><span class="hs-identifier">GHC.Utils.Outputable</span></a></span><span>
</span><span id="line-27"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="../../ghc-boot/src/GHC.Platform.html#"><span class="hs-identifier">GHC.Platform</span></a></span><span>
</span><span id="line-28"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Types.Unique.Supply.html"><span class="hs-identifier">GHC.Types.Unique.Supply</span></a></span><span>
</span><span id="line-29"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Cmm.Dataflow.Block.html"><span class="hs-identifier">GHC.Cmm.Dataflow.Block</span></a></span><span>
</span><span id="line-30"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Cmm.Dataflow.Collections.html"><span class="hs-identifier">GHC.Cmm.Dataflow.Collections</span></a></span><span>
</span><span id="line-31"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Cmm.Dataflow.html"><span class="hs-identifier">GHC.Cmm.Dataflow</span></a></span><span>
</span><span id="line-32"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Cmm.Dataflow.Graph.html"><span class="hs-identifier">GHC.Cmm.Dataflow.Graph</span></a></span><span>
</span><span id="line-33"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Cmm.Dataflow.Label.html"><span class="hs-identifier">GHC.Cmm.Dataflow.Label</span></a></span><span>
</span><span id="line-34"></span><span>
</span><span id="line-35"></span><span class="hs-comment">-- Compute a minimal set of proc points for a control-flow graph.</span><span>
</span><span id="line-36"></span><span>
</span><span id="line-37"></span><span class="hs-comment">-- Determine a protocol for each proc point (which live variables will</span><span>
</span><span id="line-38"></span><span class="hs-comment">-- be passed as arguments and which will be on the stack).</span><span>
</span><span id="line-39"></span><span>
</span><span id="line-40"></span><span class="hs-comment">{-
A proc point is a basic block that, after CPS transformation, will
start a new function.  The entry block of the original function is a
proc point, as is the continuation of each function call.
A third kind of proc point arises if we want to avoid copying code.
Suppose we have code like the following:

  f() {
    if (...) { ..1..; call foo(); ..2..}
    else     { ..3..; call bar(); ..4..}
    x = y + z;
    return x;
  }

The statement 'x = y + z' can be reached from two different proc
points: the continuations of foo() and bar().  We would prefer not to
put a copy in each continuation; instead we would like 'x = y + z' to
be the start of a new procedure to which the continuations can jump:

  f_cps () {
    if (...) { ..1..; push k_foo; jump foo_cps(); }
    else     { ..3..; push k_bar; jump bar_cps(); }
  }
  k_foo() { ..2..; jump k_join(y, z); }
  k_bar() { ..4..; jump k_join(y, z); }
  k_join(y, z) { x = y + z; return x; }

You might think then that a criterion to make a node a proc point is
that it is directly reached by two distinct proc points.  (Note
[Direct reachability].)  But this criterion is a bit too simple; for
example, 'return x' is also reached by two proc points, yet there is
no point in pulling it out of k_join.  A good criterion would be to
say that a node should be made a proc point if it is reached by a set
of proc points that is different than its immediate dominator.  NR
believes this criterion can be shown to produce a minimum set of proc
points, and given a dominator tree, the proc points can be chosen in
time linear in the number of blocks.  Lacking a dominator analysis,
however, we turn instead to an iterative solution, starting with no
proc points and adding them according to these rules:

  1. The entry block is a proc point.
  2. The continuation of a call is a proc point.
  3. A node is a proc point if it is directly reached by more proc
     points than one of its predecessors.

Because we don't understand the problem very well, we apply rule 3 at
most once per iteration, then recompute the reachability information.
(See Note [No simple dataflow].)  The choice of the new proc point is
arbitrary, and I don't know if the choice affects the final solution,
so I don't know if the number of proc points chosen is the
minimum---but the set will be minimal.



Note [Proc-point analysis]
~~~~~~~~~~~~~~~~~~~~~~~~~~

Given a specified set of proc-points (a set of block-ids), &quot;proc-point
analysis&quot; figures out, for every block, which proc-point it belongs to.
All the blocks belonging to proc-point P will constitute a single
top-level C procedure.

A non-proc-point block B &quot;belongs to&quot; a proc-point P iff B is
reachable from P without going through another proc-point.

Invariant: a block B should belong to at most one proc-point; if it
belongs to two, that's a bug.

Note [Non-existing proc-points]
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

On some architectures it might happen that the list of proc-points
computed before stack layout pass will be invalidated by the stack
layout. This will happen if stack layout removes from the graph
blocks that were determined to be proc-points. Later on in the pipeline
we use list of proc-points to perform [Proc-point analysis], but
if a proc-point does not exist anymore then we will get compiler panic.
See #8205.
-}</span><span>
</span><span id="line-119"></span><span>
</span><span id="line-120"></span><span class="hs-keyword">type</span><span> </span><span id="ProcPointSet"><span class="annot"><a href="GHC.Cmm.ProcPoint.html#ProcPointSet"><span class="hs-identifier hs-var">ProcPointSet</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><a href="GHC.Cmm.Dataflow.Label.html#LabelSet"><span class="hs-identifier hs-type">LabelSet</span></a></span><span>
</span><span id="line-121"></span><span>
</span><span id="line-122"></span><span class="hs-keyword">data</span><span> </span><span id="Status"><span class="annot"><a href="GHC.Cmm.ProcPoint.html#Status"><span class="hs-identifier hs-var">Status</span></a></span></span><span>
</span><span id="line-123"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span id="ReachedBy"><span class="annot"><a href="GHC.Cmm.ProcPoint.html#ReachedBy"><span class="hs-identifier hs-var">ReachedBy</span></a></span></span><span> </span><span class="annot"><a href="GHC.Cmm.ProcPoint.html#ProcPointSet"><span class="hs-identifier hs-type">ProcPointSet</span></a></span><span>  </span><span class="hs-comment">-- set of proc points that directly reach the block</span><span>
</span><span id="line-124"></span><span>  </span><span class="hs-glyph">|</span><span> </span><span id="ProcPoint"><span class="annot"><a href="GHC.Cmm.ProcPoint.html#ProcPoint"><span class="hs-identifier hs-var">ProcPoint</span></a></span></span><span>               </span><span class="hs-comment">-- this block is itself a proc point</span><span>
</span><span id="line-125"></span><span>
</span><span id="line-126"></span><span class="hs-keyword">instance</span><span> </span><span id="local-6989586621681046911"><span class="annot"><a href="GHC.Utils.Outputable.html#Outputable"><span class="hs-identifier hs-type">Outputable</span></a></span><span> </span><span class="annot"><a href="GHC.Cmm.ProcPoint.html#Status"><span class="hs-identifier hs-type">Status</span></a></span></span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-127"></span><span>  </span><span id="local-6989586621681046906"><span class="annot"><span class="annottext">ppr :: Status -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var hs-var hs-var hs-var">ppr</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Cmm.ProcPoint.html#ReachedBy"><span class="hs-identifier hs-type">ReachedBy</span></a></span><span> </span><span id="local-6989586621681046904"><span class="annot"><span class="annottext">ProcPointSet
</span><a href="#local-6989586621681046904"><span class="hs-identifier hs-var">ps</span></a></span></span><span class="hs-special">)</span><span>
</span><span id="line-128"></span><span>      </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">ProcPointSet -&gt; Bool
forall set. IsSet set =&gt; set -&gt; Bool
</span><a href="GHC.Cmm.Dataflow.Collections.html#setNull"><span class="hs-identifier hs-var">setNull</span></a></span><span> </span><span class="annot"><span class="annottext">ProcPointSet
</span><a href="#local-6989586621681046904"><span class="hs-identifier hs-var">ps</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">String -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;&lt;not-reached&gt;&quot;</span></span><span>
</span><span id="line-129"></span><span>      </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="../../base/src/GHC.Base.html#otherwise"><span class="hs-identifier hs-var">otherwise</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">String -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;reached by&quot;</span></span><span> </span><span class="annot"><span class="annottext">SDoc -&gt; SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#%3C%2B%3E"><span class="hs-operator hs-var">&lt;+&gt;</span></a></span><span>
</span><span id="line-130"></span><span>                    </span><span class="hs-special">(</span><span class="annot"><span class="annottext">[SDoc] -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#hsep"><span class="hs-identifier hs-var">hsep</span></a></span><span> </span><span class="annot"><span class="annottext">([SDoc] -&gt; SDoc) -&gt; [SDoc] -&gt; SDoc
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">SDoc -&gt; [SDoc] -&gt; [SDoc]
</span><a href="GHC.Utils.Outputable.html#punctuate"><span class="hs-identifier hs-var">punctuate</span></a></span><span> </span><span class="annot"><span class="annottext">SDoc
</span><a href="GHC.Utils.Outputable.html#comma"><span class="hs-identifier hs-var">comma</span></a></span><span> </span><span class="annot"><span class="annottext">([SDoc] -&gt; [SDoc]) -&gt; [SDoc] -&gt; [SDoc]
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">(BlockId -&gt; SDoc) -&gt; [BlockId] -&gt; [SDoc]
forall a b. (a -&gt; b) -&gt; [a] -&gt; [b]
</span><a href="../../base/src/GHC.Base.html#map"><span class="hs-identifier hs-var">map</span></a></span><span> </span><span class="annot"><span class="annottext">BlockId -&gt; SDoc
forall a. Outputable a =&gt; a -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="annot"><span class="annottext">([BlockId] -&gt; [SDoc]) -&gt; [BlockId] -&gt; [SDoc]
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">ProcPointSet -&gt; [ElemOf ProcPointSet]
forall set. IsSet set =&gt; set -&gt; [ElemOf set]
</span><a href="GHC.Cmm.Dataflow.Collections.html#setElems"><span class="hs-identifier hs-var">setElems</span></a></span><span> </span><span class="annot"><span class="annottext">ProcPointSet
</span><a href="#local-6989586621681046904"><span class="hs-identifier hs-var">ps</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-131"></span><span>  </span><span class="annot"><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="annot"><span class="annottext">Status
</span><a href="GHC.Cmm.ProcPoint.html#ProcPoint"><span class="hs-identifier hs-var">ProcPoint</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">String -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;&lt;procpt&gt;&quot;</span></span><span>
</span><span id="line-132"></span><span>
</span><span id="line-133"></span><span class="hs-comment">--------------------------------------------------</span><span>
</span><span id="line-134"></span><span class="hs-comment">-- Proc point analysis</span><span>
</span><span id="line-135"></span><span>
</span><span id="line-136"></span><span class="hs-comment">-- Once you know what the proc-points are, figure out</span><span>
</span><span id="line-137"></span><span class="hs-comment">-- what proc-points each block is reachable from</span><span>
</span><span id="line-138"></span><span class="hs-comment">-- See Note [Proc-point analysis]</span><span>
</span><span id="line-139"></span><span class="annot"><a href="GHC.Cmm.ProcPoint.html#procPointAnalysis"><span class="hs-identifier hs-type">procPointAnalysis</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Cmm.ProcPoint.html#ProcPointSet"><span class="hs-identifier hs-type">ProcPointSet</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Cmm.html#CmmGraph"><span class="hs-identifier hs-type">CmmGraph</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Cmm.Dataflow.Label.html#LabelMap"><span class="hs-identifier hs-type">LabelMap</span></a></span><span> </span><span class="annot"><a href="GHC.Cmm.ProcPoint.html#Status"><span class="hs-identifier hs-type">Status</span></a></span><span>
</span><span id="line-140"></span><span id="procPointAnalysis"><span class="annot"><span class="annottext">procPointAnalysis :: ProcPointSet -&gt; CmmGraph -&gt; LabelMap Status
</span><a href="GHC.Cmm.ProcPoint.html#procPointAnalysis"><span class="hs-identifier hs-var hs-var">procPointAnalysis</span></a></span></span><span> </span><span id="local-6989586621681046896"><span class="annot"><span class="annottext">ProcPointSet
</span><a href="#local-6989586621681046896"><span class="hs-identifier hs-var">procPoints</span></a></span></span><span> </span><span id="local-6989586621681046895"><span class="annot"><span class="annottext">cmmGraph :: CmmGraph
</span><a href="#local-6989586621681046895"><span class="hs-identifier hs-var">cmmGraph</span></a></span></span><span class="hs-glyph">@</span><span class="hs-special">(</span><span class="annot"><a href="GHC.Cmm.html#CmmGraph"><span class="hs-identifier hs-type">CmmGraph</span></a></span><span> </span><span class="hs-special">{</span><span class="annot"><span class="annottext">g_graph :: forall (n :: Extensibility -&gt; Extensibility -&gt; *).
GenCmmGraph n -&gt; Graph n C C
</span><a href="GHC.Cmm.html#g_graph"><span class="hs-identifier hs-var">g_graph</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span id="local-6989586621681046892"><span class="annot"><span class="annottext">Graph CmmNode C C
</span><a href="#local-6989586621681046892"><span class="hs-identifier hs-var">graph</span></a></span></span><span class="hs-special">}</span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span>
</span><span id="line-141"></span><span>    </span><span class="annot"><span class="annottext">DataflowLattice Status
-&gt; TransferFun Status
-&gt; CmmGraph
-&gt; LabelMap Status
-&gt; LabelMap Status
forall f.
DataflowLattice f
-&gt; TransferFun f -&gt; CmmGraph -&gt; FactBase f -&gt; FactBase f
</span><a href="GHC.Cmm.Dataflow.html#analyzeCmmFwd"><span class="hs-identifier hs-var">analyzeCmmFwd</span></a></span><span> </span><span class="annot"><span class="annottext">DataflowLattice Status
</span><a href="GHC.Cmm.ProcPoint.html#procPointLattice"><span class="hs-identifier hs-var">procPointLattice</span></a></span><span> </span><span class="annot"><span class="annottext">TransferFun Status
</span><a href="GHC.Cmm.ProcPoint.html#procPointTransfer"><span class="hs-identifier hs-var">procPointTransfer</span></a></span><span> </span><span class="annot"><span class="annottext">CmmGraph
</span><a href="#local-6989586621681046895"><span class="hs-identifier hs-var">cmmGraph</span></a></span><span> </span><span class="annot"><span class="annottext">LabelMap Status
</span><a href="#local-6989586621681046888"><span class="hs-identifier hs-var">initProcPoints</span></a></span><span>
</span><span id="line-142"></span><span>  </span><span class="hs-keyword">where</span><span>
</span><span id="line-143"></span><span>    </span><span id="local-6989586621681046888"><span class="annot"><span class="annottext">initProcPoints :: LabelMap Status
</span><a href="#local-6989586621681046888"><span class="hs-identifier hs-var hs-var">initProcPoints</span></a></span></span><span> </span><span class="hs-glyph">=</span><span>
</span><span id="line-144"></span><span>        </span><span class="annot"><span class="annottext">DataflowLattice Status -&gt; [(BlockId, Status)] -&gt; LabelMap Status
forall f. DataflowLattice f -&gt; [(BlockId, f)] -&gt; FactBase f
</span><a href="GHC.Cmm.Dataflow.html#mkFactBase"><span class="hs-identifier hs-var">mkFactBase</span></a></span><span>
</span><span id="line-145"></span><span>            </span><span class="annot"><span class="annottext">DataflowLattice Status
</span><a href="GHC.Cmm.ProcPoint.html#procPointLattice"><span class="hs-identifier hs-var">procPointLattice</span></a></span><span>
</span><span id="line-146"></span><span>            </span><span class="hs-special">[</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">BlockId
</span><a href="#local-6989586621681046886"><span class="hs-identifier hs-var">id</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">Status
</span><a href="GHC.Cmm.ProcPoint.html#ProcPoint"><span class="hs-identifier hs-var">ProcPoint</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-147"></span><span>            </span><span class="hs-glyph">|</span><span> </span><span id="local-6989586621681046886"><span class="annot"><span class="annottext">BlockId
</span><a href="#local-6989586621681046886"><span class="hs-identifier hs-var">id</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">ProcPointSet -&gt; [ElemOf ProcPointSet]
forall set. IsSet set =&gt; set -&gt; [ElemOf set]
</span><a href="GHC.Cmm.Dataflow.Collections.html#setElems"><span class="hs-identifier hs-var">setElems</span></a></span><span> </span><span class="annot"><span class="annottext">ProcPointSet
</span><a href="#local-6989586621681046896"><span class="hs-identifier hs-var">procPoints</span></a></span><span>
</span><span id="line-148"></span><span>            </span><span class="hs-comment">-- See Note [Non-existing proc-points]</span><span>
</span><span id="line-149"></span><span>            </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">ElemOf ProcPointSet
BlockId
</span><a href="#local-6989586621681046886"><span class="hs-identifier hs-var">id</span></a></span><span> </span><span class="annot"><span class="annottext">ElemOf ProcPointSet -&gt; ProcPointSet -&gt; Bool
forall set. IsSet set =&gt; ElemOf set -&gt; set -&gt; Bool
</span><a href="GHC.Cmm.Dataflow.Collections.html#setMember"><span class="hs-operator hs-var">`setMember`</span></a></span><span> </span><span class="annot"><span class="annottext">ProcPointSet
</span><a href="#local-6989586621681046884"><span class="hs-identifier hs-var">labelsInGraph</span></a></span><span>
</span><span id="line-150"></span><span>            </span><span class="hs-special">]</span><span>
</span><span id="line-151"></span><span>    </span><span id="local-6989586621681046884"><span class="annot"><span class="annottext">labelsInGraph :: ProcPointSet
</span><a href="#local-6989586621681046884"><span class="hs-identifier hs-var hs-var">labelsInGraph</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Graph CmmNode C C -&gt; ProcPointSet
forall (block :: (Extensibility -&gt; Extensibility -&gt; *)
                 -&gt; Extensibility -&gt; Extensibility -&gt; *)
       (n :: Extensibility -&gt; Extensibility -&gt; *) (e :: Extensibility)
       (x :: Extensibility).
NonLocal (block n) =&gt;
Graph' block n e x -&gt; ProcPointSet
</span><a href="GHC.Cmm.Dataflow.Graph.html#labelsDefined"><span class="hs-identifier hs-var">labelsDefined</span></a></span><span> </span><span class="annot"><span class="annottext">Graph CmmNode C C
</span><a href="#local-6989586621681046892"><span class="hs-identifier hs-var">graph</span></a></span><span>
</span><span id="line-152"></span><span>
</span><span id="line-153"></span><span class="annot"><a href="GHC.Cmm.ProcPoint.html#procPointTransfer"><span class="hs-identifier hs-type">procPointTransfer</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Cmm.Dataflow.html#TransferFun"><span class="hs-identifier hs-type">TransferFun</span></a></span><span> </span><span class="annot"><a href="GHC.Cmm.ProcPoint.html#Status"><span class="hs-identifier hs-type">Status</span></a></span><span>
</span><span id="line-154"></span><span id="procPointTransfer"><span class="annot"><span class="annottext">procPointTransfer :: TransferFun Status
</span><a href="GHC.Cmm.ProcPoint.html#procPointTransfer"><span class="hs-identifier hs-var hs-var">procPointTransfer</span></a></span></span><span> </span><span id="local-6989586621681046882"><span class="annot"><span class="annottext">Block CmmNode C C
</span><a href="#local-6989586621681046882"><span class="hs-identifier hs-var">block</span></a></span></span><span> </span><span id="local-6989586621681046881"><span class="annot"><span class="annottext">LabelMap Status
</span><a href="#local-6989586621681046881"><span class="hs-identifier hs-var">facts</span></a></span></span><span> </span><span class="hs-glyph">=</span><span>
</span><span id="line-155"></span><span>    </span><span class="hs-keyword">let</span><span> </span><span id="local-6989586621681046880"><span class="annot"><span class="annottext">label :: BlockId
</span><a href="#local-6989586621681046880"><span class="hs-keyword hs-var hs-var">label</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Block CmmNode C C -&gt; BlockId
forall (thing :: Extensibility -&gt; Extensibility -&gt; *)
       (x :: Extensibility).
NonLocal thing =&gt;
thing C x -&gt; BlockId
</span><a href="GHC.Cmm.Dataflow.Graph.html#entryLabel"><span class="hs-identifier hs-var">entryLabel</span></a></span><span> </span><span class="annot"><span class="annottext">Block CmmNode C C
</span><a href="#local-6989586621681046882"><span class="hs-identifier hs-var">block</span></a></span><span>
</span><span id="line-156"></span><span>        </span><span class="hs-glyph">!</span><span id="local-6989586621681046878"><span class="annot"><span class="annottext">fact :: Status
</span><a href="#local-6989586621681046878"><span class="hs-identifier hs-var hs-var">fact</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">DataflowLattice Status -&gt; BlockId -&gt; LabelMap Status -&gt; Status
forall f. DataflowLattice f -&gt; BlockId -&gt; FactBase f -&gt; f
</span><a href="GHC.Cmm.Dataflow.html#getFact"><span class="hs-identifier hs-var">getFact</span></a></span><span> </span><span class="annot"><span class="annottext">DataflowLattice Status
</span><a href="GHC.Cmm.ProcPoint.html#procPointLattice"><span class="hs-identifier hs-var">procPointLattice</span></a></span><span> </span><span class="annot"><span class="annottext">BlockId
</span><a href="#local-6989586621681046880"><span class="hs-keyword hs-var">label</span></a></span><span> </span><span class="annot"><span class="annottext">LabelMap Status
</span><a href="#local-6989586621681046881"><span class="hs-identifier hs-var">facts</span></a></span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-157"></span><span>            </span><span class="annot"><span class="annottext">Status
</span><a href="GHC.Cmm.ProcPoint.html#ProcPoint"><span class="hs-identifier hs-var">ProcPoint</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">ProcPointSet -&gt; Status
</span><a href="GHC.Cmm.ProcPoint.html#ReachedBy"><span class="hs-identifier hs-var">ReachedBy</span></a></span><span> </span><span class="annot"><span class="annottext">(ProcPointSet -&gt; Status) -&gt; ProcPointSet -&gt; Status
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24%21"><span class="hs-operator hs-var">$!</span></a></span><span> </span><span class="annot"><span class="annottext">ElemOf ProcPointSet -&gt; ProcPointSet
forall set. IsSet set =&gt; ElemOf set -&gt; set
</span><a href="GHC.Cmm.Dataflow.Collections.html#setSingleton"><span class="hs-identifier hs-var">setSingleton</span></a></span><span> </span><span class="annot"><span class="annottext">ElemOf ProcPointSet
BlockId
</span><a href="#local-6989586621681046880"><span class="hs-keyword hs-var">label</span></a></span><span>
</span><span id="line-158"></span><span>            </span><span id="local-6989586621681046874"><span class="annot"><span class="annottext">Status
</span><a href="#local-6989586621681046874"><span class="hs-identifier hs-var">f</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">Status
</span><a href="#local-6989586621681046874"><span class="hs-identifier hs-var">f</span></a></span><span>
</span><span id="line-159"></span><span>        </span><span id="local-6989586621681046873"><span class="annot"><span class="annottext">result :: [(BlockId, Status)]
</span><a href="#local-6989586621681046873"><span class="hs-identifier hs-var hs-var">result</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(BlockId -&gt; (BlockId, Status)) -&gt; [BlockId] -&gt; [(BlockId, Status)]
forall a b. (a -&gt; b) -&gt; [a] -&gt; [b]
</span><a href="../../base/src/GHC.Base.html#map"><span class="hs-identifier hs-var">map</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-glyph">\</span><span id="local-6989586621681046872"><span class="annot"><span class="annottext">BlockId
</span><a href="#local-6989586621681046872"><span class="hs-identifier hs-var">id</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">BlockId
</span><a href="#local-6989586621681046872"><span class="hs-identifier hs-var">id</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">Status
</span><a href="#local-6989586621681046878"><span class="hs-identifier hs-var">fact</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Block CmmNode C C -&gt; [BlockId]
forall (thing :: Extensibility -&gt; Extensibility -&gt; *)
       (e :: Extensibility).
NonLocal thing =&gt;
thing e C -&gt; [BlockId]
</span><a href="GHC.Cmm.Dataflow.Graph.html#successors"><span class="hs-identifier hs-var">successors</span></a></span><span> </span><span class="annot"><span class="annottext">Block CmmNode C C
</span><a href="#local-6989586621681046882"><span class="hs-identifier hs-var">block</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-160"></span><span>    </span><span class="hs-keyword">in</span><span> </span><span class="annot"><span class="annottext">DataflowLattice Status -&gt; [(BlockId, Status)] -&gt; LabelMap Status
forall f. DataflowLattice f -&gt; [(BlockId, f)] -&gt; FactBase f
</span><a href="GHC.Cmm.Dataflow.html#mkFactBase"><span class="hs-identifier hs-var">mkFactBase</span></a></span><span> </span><span class="annot"><span class="annottext">DataflowLattice Status
</span><a href="GHC.Cmm.ProcPoint.html#procPointLattice"><span class="hs-identifier hs-var">procPointLattice</span></a></span><span> </span><span class="annot"><span class="annottext">[(BlockId, Status)]
</span><a href="#local-6989586621681046873"><span class="hs-identifier hs-var">result</span></a></span><span>
</span><span id="line-161"></span><span>
</span><span id="line-162"></span><span class="annot"><a href="GHC.Cmm.ProcPoint.html#procPointLattice"><span class="hs-identifier hs-type">procPointLattice</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Cmm.Dataflow.html#DataflowLattice"><span class="hs-identifier hs-type">DataflowLattice</span></a></span><span> </span><span class="annot"><a href="GHC.Cmm.ProcPoint.html#Status"><span class="hs-identifier hs-type">Status</span></a></span><span>
</span><span id="line-163"></span><span id="procPointLattice"><span class="annot"><span class="annottext">procPointLattice :: DataflowLattice Status
</span><a href="GHC.Cmm.ProcPoint.html#procPointLattice"><span class="hs-identifier hs-var hs-var">procPointLattice</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Status -&gt; JoinFun Status -&gt; DataflowLattice Status
forall a. a -&gt; JoinFun a -&gt; DataflowLattice a
</span><a href="GHC.Cmm.Dataflow.html#DataflowLattice"><span class="hs-identifier hs-var">DataflowLattice</span></a></span><span> </span><span class="annot"><span class="annottext">Status
</span><a href="#local-6989586621681046869"><span class="hs-identifier hs-var">unreached</span></a></span><span> </span><span class="annot"><span class="annottext">JoinFun Status
</span><a href="#local-6989586621681046868"><span class="hs-identifier hs-var">add_to</span></a></span><span>
</span><span id="line-164"></span><span>  </span><span class="hs-keyword">where</span><span>
</span><span id="line-165"></span><span>    </span><span id="local-6989586621681046869"><span class="annot"><span class="annottext">unreached :: Status
</span><a href="#local-6989586621681046869"><span class="hs-identifier hs-var hs-var">unreached</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">ProcPointSet -&gt; Status
</span><a href="GHC.Cmm.ProcPoint.html#ReachedBy"><span class="hs-identifier hs-var">ReachedBy</span></a></span><span> </span><span class="annot"><span class="annottext">ProcPointSet
forall set. IsSet set =&gt; set
</span><a href="GHC.Cmm.Dataflow.Collections.html#setEmpty"><span class="hs-identifier hs-var">setEmpty</span></a></span><span>
</span><span id="line-166"></span><span>    </span><span id="local-6989586621681046868"><span class="annot"><span class="annottext">add_to :: JoinFun Status
</span><a href="#local-6989586621681046868"><span class="hs-identifier hs-var hs-var">add_to</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Cmm.Dataflow.html#OldFact"><span class="hs-identifier hs-type">OldFact</span></a></span><span> </span><span class="annot"><span class="annottext">Status
</span><a href="GHC.Cmm.ProcPoint.html#ProcPoint"><span class="hs-identifier hs-var">ProcPoint</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">NewFact Status
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Status -&gt; JoinedFact Status
forall a. a -&gt; JoinedFact a
</span><a href="GHC.Cmm.Dataflow.html#NotChanged"><span class="hs-identifier hs-var">NotChanged</span></a></span><span> </span><span class="annot"><span class="annottext">Status
</span><a href="GHC.Cmm.ProcPoint.html#ProcPoint"><span class="hs-identifier hs-var">ProcPoint</span></a></span><span>
</span><span id="line-167"></span><span>    </span><span class="annot"><a href="#local-6989586621681046868"><span class="hs-identifier hs-var">add_to</span></a></span><span> </span><span class="annot"><span class="annottext">OldFact Status
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Cmm.Dataflow.html#NewFact"><span class="hs-identifier hs-type">NewFact</span></a></span><span> </span><span class="annot"><span class="annottext">Status
</span><a href="GHC.Cmm.ProcPoint.html#ProcPoint"><span class="hs-identifier hs-var">ProcPoint</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Status -&gt; JoinedFact Status
forall a. a -&gt; JoinedFact a
</span><a href="GHC.Cmm.Dataflow.html#Changed"><span class="hs-identifier hs-var">Changed</span></a></span><span> </span><span class="annot"><span class="annottext">Status
</span><a href="GHC.Cmm.ProcPoint.html#ProcPoint"><span class="hs-identifier hs-var">ProcPoint</span></a></span><span> </span><span class="hs-comment">-- because of previous case</span><span>
</span><span id="line-168"></span><span>    </span><span class="annot"><a href="#local-6989586621681046868"><span class="hs-identifier hs-var">add_to</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Cmm.Dataflow.html#OldFact"><span class="hs-identifier hs-type">OldFact</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Cmm.ProcPoint.html#ReachedBy"><span class="hs-identifier hs-type">ReachedBy</span></a></span><span> </span><span id="local-6989586621681046857"><span class="annot"><span class="annottext">ProcPointSet
</span><a href="#local-6989586621681046857"><span class="hs-identifier hs-var">p</span></a></span></span><span class="hs-special">)</span><span class="hs-special">)</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Cmm.Dataflow.html#NewFact"><span class="hs-identifier hs-type">NewFact</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Cmm.ProcPoint.html#ReachedBy"><span class="hs-identifier hs-type">ReachedBy</span></a></span><span> </span><span id="local-6989586621681046856"><span class="annot"><span class="annottext">ProcPointSet
</span><a href="#local-6989586621681046856"><span class="hs-identifier hs-var">p'</span></a></span></span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-169"></span><span>        </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">ProcPointSet -&gt; Int
forall set. IsSet set =&gt; set -&gt; Int
</span><a href="GHC.Cmm.Dataflow.Collections.html#setSize"><span class="hs-identifier hs-var">setSize</span></a></span><span> </span><span class="annot"><span class="annottext">ProcPointSet
</span><a href="#local-6989586621681046854"><span class="hs-identifier hs-var">union</span></a></span><span> </span><span class="annot"><span class="annottext">Int -&gt; Int -&gt; Bool
forall a. Ord a =&gt; a -&gt; a -&gt; Bool
</span><span class="hs-operator hs-var">&gt;</span></span><span> </span><span class="annot"><span class="annottext">ProcPointSet -&gt; Int
forall set. IsSet set =&gt; set -&gt; Int
</span><a href="GHC.Cmm.Dataflow.Collections.html#setSize"><span class="hs-identifier hs-var">setSize</span></a></span><span> </span><span class="annot"><span class="annottext">ProcPointSet
</span><a href="#local-6989586621681046857"><span class="hs-identifier hs-var">p</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Status -&gt; JoinedFact Status
forall a. a -&gt; JoinedFact a
</span><a href="GHC.Cmm.Dataflow.html#Changed"><span class="hs-identifier hs-var">Changed</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">ProcPointSet -&gt; Status
</span><a href="GHC.Cmm.ProcPoint.html#ReachedBy"><span class="hs-identifier hs-var">ReachedBy</span></a></span><span> </span><span class="annot"><span class="annottext">ProcPointSet
</span><a href="#local-6989586621681046854"><span class="hs-identifier hs-var">union</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-170"></span><span>        </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="../../base/src/GHC.Base.html#otherwise"><span class="hs-identifier hs-var">otherwise</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Status -&gt; JoinedFact Status
forall a. a -&gt; JoinedFact a
</span><a href="GHC.Cmm.Dataflow.html#NotChanged"><span class="hs-identifier hs-var">NotChanged</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">ProcPointSet -&gt; Status
</span><a href="GHC.Cmm.ProcPoint.html#ReachedBy"><span class="hs-identifier hs-var">ReachedBy</span></a></span><span> </span><span class="annot"><span class="annottext">ProcPointSet
</span><a href="#local-6989586621681046857"><span class="hs-identifier hs-var">p</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-171"></span><span>      </span><span class="hs-keyword">where</span><span>
</span><span id="line-172"></span><span>        </span><span id="local-6989586621681046854"><span class="annot"><span class="annottext">union :: ProcPointSet
</span><a href="#local-6989586621681046854"><span class="hs-identifier hs-var hs-var">union</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">ProcPointSet -&gt; ProcPointSet -&gt; ProcPointSet
forall set. IsSet set =&gt; set -&gt; set -&gt; set
</span><a href="GHC.Cmm.Dataflow.Collections.html#setUnion"><span class="hs-identifier hs-var">setUnion</span></a></span><span> </span><span class="annot"><span class="annottext">ProcPointSet
</span><a href="#local-6989586621681046856"><span class="hs-identifier hs-var">p'</span></a></span><span> </span><span class="annot"><span class="annottext">ProcPointSet
</span><a href="#local-6989586621681046857"><span class="hs-identifier hs-var">p</span></a></span><span>
</span><span id="line-173"></span><span>
</span><span id="line-174"></span><span class="hs-comment">----------------------------------------------------------------------</span><span>
</span><span id="line-175"></span><span>
</span><span id="line-176"></span><span class="hs-comment">-- It is worth distinguishing two sets of proc points: those that are</span><span>
</span><span id="line-177"></span><span class="hs-comment">-- induced by calls in the original graph and those that are</span><span>
</span><span id="line-178"></span><span class="hs-comment">-- introduced because they're reachable from multiple proc points.</span><span>
</span><span id="line-179"></span><span class="hs-comment">--</span><span>
</span><span id="line-180"></span><span class="hs-comment">-- Extract the set of Continuation BlockIds, see Note [Continuation BlockIds].</span><span>
</span><span id="line-181"></span><span class="annot"><a href="GHC.Cmm.ProcPoint.html#callProcPoints"><span class="hs-identifier hs-type">callProcPoints</span></a></span><span>      </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Cmm.html#CmmGraph"><span class="hs-identifier hs-type">CmmGraph</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Cmm.ProcPoint.html#ProcPointSet"><span class="hs-identifier hs-type">ProcPointSet</span></a></span><span>
</span><span id="line-182"></span><span id="callProcPoints"><span class="annot"><span class="annottext">callProcPoints :: CmmGraph -&gt; ProcPointSet
</span><a href="GHC.Cmm.ProcPoint.html#callProcPoints"><span class="hs-identifier hs-var hs-var">callProcPoints</span></a></span></span><span> </span><span id="local-6989586621681046851"><span class="annot"><span class="annottext">CmmGraph
</span><a href="#local-6989586621681046851"><span class="hs-identifier hs-var">g</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(ProcPointSet -&gt; Block CmmNode C C -&gt; ProcPointSet)
-&gt; ProcPointSet -&gt; CmmGraph -&gt; ProcPointSet
forall a. (a -&gt; Block CmmNode C C -&gt; a) -&gt; a -&gt; CmmGraph -&gt; a
</span><a href="GHC.Cmm.Utils.html#foldlGraphBlocks"><span class="hs-identifier hs-var">foldlGraphBlocks</span></a></span><span> </span><span class="annot"><span class="annottext">ProcPointSet -&gt; Block CmmNode C C -&gt; ProcPointSet
</span><a href="#local-6989586621681046849"><span class="hs-identifier hs-var">add</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">ElemOf ProcPointSet -&gt; ProcPointSet
forall set. IsSet set =&gt; ElemOf set -&gt; set
</span><a href="GHC.Cmm.Dataflow.Collections.html#setSingleton"><span class="hs-identifier hs-var">setSingleton</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">CmmGraph -&gt; BlockId
forall (n :: Extensibility -&gt; Extensibility -&gt; *).
GenCmmGraph n -&gt; BlockId
</span><a href="GHC.Cmm.html#g_entry"><span class="hs-identifier hs-var hs-var">g_entry</span></a></span><span> </span><span class="annot"><span class="annottext">CmmGraph
</span><a href="#local-6989586621681046851"><span class="hs-identifier hs-var">g</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">CmmGraph
</span><a href="#local-6989586621681046851"><span class="hs-identifier hs-var">g</span></a></span><span>
</span><span id="line-183"></span><span>  </span><span class="hs-keyword">where</span><span> </span><span class="annot"><a href="#local-6989586621681046849"><span class="hs-identifier hs-type">add</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Cmm.Dataflow.Label.html#LabelSet"><span class="hs-identifier hs-type">LabelSet</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Cmm.html#CmmBlock"><span class="hs-identifier hs-type">CmmBlock</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Cmm.Dataflow.Label.html#LabelSet"><span class="hs-identifier hs-type">LabelSet</span></a></span><span>
</span><span id="line-184"></span><span>        </span><span id="local-6989586621681046849"><span class="annot"><span class="annottext">add :: ProcPointSet -&gt; Block CmmNode C C -&gt; ProcPointSet
</span><a href="#local-6989586621681046849"><span class="hs-identifier hs-var hs-var">add</span></a></span></span><span> </span><span id="local-6989586621681046846"><span class="annot"><span class="annottext">ProcPointSet
</span><a href="#local-6989586621681046846"><span class="hs-identifier hs-var">set</span></a></span></span><span> </span><span id="local-6989586621681046845"><span class="annot"><span class="annottext">Block CmmNode C C
</span><a href="#local-6989586621681046845"><span class="hs-identifier hs-var">b</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">Block CmmNode C C -&gt; CmmNode O C
forall (n :: Extensibility -&gt; Extensibility -&gt; *)
       (x :: Extensibility).
Block n x C -&gt; n O C
</span><a href="GHC.Cmm.Dataflow.Block.html#lastNode"><span class="hs-identifier hs-var">lastNode</span></a></span><span> </span><span class="annot"><span class="annottext">Block CmmNode C C
</span><a href="#local-6989586621681046845"><span class="hs-identifier hs-var">b</span></a></span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-185"></span><span>                      </span><span class="annot"><a href="GHC.Cmm.Node.html#CmmCall"><span class="hs-identifier hs-type">CmmCall</span></a></span><span> </span><span class="hs-special">{</span><span class="annot"><span class="annottext">cml_cont :: CmmNode O C -&gt; Maybe BlockId
</span><a href="GHC.Cmm.Node.html#cml_cont"><span class="hs-identifier hs-var">cml_cont</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-type">Just</span></a></span><span> </span><span id="local-6989586621681046838"><span class="annot"><span class="annottext">BlockId
</span><a href="#local-6989586621681046838"><span class="hs-identifier hs-var">k</span></a></span></span><span class="hs-special">}</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">ElemOf ProcPointSet -&gt; ProcPointSet -&gt; ProcPointSet
forall set. IsSet set =&gt; ElemOf set -&gt; set -&gt; set
</span><a href="GHC.Cmm.Dataflow.Collections.html#setInsert"><span class="hs-identifier hs-var">setInsert</span></a></span><span> </span><span class="annot"><span class="annottext">ElemOf ProcPointSet
BlockId
</span><a href="#local-6989586621681046838"><span class="hs-identifier hs-var">k</span></a></span><span> </span><span class="annot"><span class="annottext">ProcPointSet
</span><a href="#local-6989586621681046846"><span class="hs-identifier hs-var">set</span></a></span><span>
</span><span id="line-186"></span><span>                      </span><span class="annot"><a href="GHC.Cmm.Node.html#CmmForeignCall"><span class="hs-identifier hs-type">CmmForeignCall</span></a></span><span> </span><span class="hs-special">{</span><span class="annot"><span class="annottext">succ :: CmmNode O C -&gt; BlockId
</span><a href="GHC.Cmm.Node.html#succ"><span class="hs-identifier hs-var">succ</span></a></span><span class="hs-glyph">=</span><span id="local-6989586621681046831"><span class="annot"><span class="annottext">BlockId
</span><a href="#local-6989586621681046831"><span class="hs-identifier hs-var">k</span></a></span></span><span class="hs-special">}</span><span>     </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">ElemOf ProcPointSet -&gt; ProcPointSet -&gt; ProcPointSet
forall set. IsSet set =&gt; ElemOf set -&gt; set -&gt; set
</span><a href="GHC.Cmm.Dataflow.Collections.html#setInsert"><span class="hs-identifier hs-var">setInsert</span></a></span><span> </span><span class="annot"><span class="annottext">ElemOf ProcPointSet
BlockId
</span><a href="#local-6989586621681046831"><span class="hs-identifier hs-var">k</span></a></span><span> </span><span class="annot"><span class="annottext">ProcPointSet
</span><a href="#local-6989586621681046846"><span class="hs-identifier hs-var">set</span></a></span><span>
</span><span id="line-187"></span><span>                      </span><span class="annot"><span class="annottext">CmmNode O C
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">ProcPointSet
</span><a href="#local-6989586621681046846"><span class="hs-identifier hs-var">set</span></a></span><span>
</span><span id="line-188"></span><span>
</span><span id="line-189"></span><span class="annot"><a href="GHC.Cmm.ProcPoint.html#minimalProcPointSet"><span class="hs-identifier hs-type">minimalProcPointSet</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../ghc-boot/src/GHC.Platform.html#Platform"><span class="hs-identifier hs-type">Platform</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Cmm.ProcPoint.html#ProcPointSet"><span class="hs-identifier hs-type">ProcPointSet</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Cmm.html#CmmGraph"><span class="hs-identifier hs-type">CmmGraph</span></a></span><span>
</span><span id="line-190"></span><span>                    </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Types.Unique.Supply.html#UniqSM"><span class="hs-identifier hs-type">UniqSM</span></a></span><span> </span><span class="annot"><a href="GHC.Cmm.ProcPoint.html#ProcPointSet"><span class="hs-identifier hs-type">ProcPointSet</span></a></span><span>
</span><span id="line-191"></span><span class="hs-comment">-- Given the set of successors of calls (which must be proc-points)</span><span>
</span><span id="line-192"></span><span class="hs-comment">-- figure out the minimal set of necessary proc-points</span><span>
</span><span id="line-193"></span><span id="minimalProcPointSet"><span class="annot"><span class="annottext">minimalProcPointSet :: Platform -&gt; ProcPointSet -&gt; CmmGraph -&gt; UniqSM ProcPointSet
</span><a href="GHC.Cmm.ProcPoint.html#minimalProcPointSet"><span class="hs-identifier hs-var hs-var">minimalProcPointSet</span></a></span></span><span> </span><span id="local-6989586621681046830"><span class="annot"><span class="annottext">Platform
</span><a href="#local-6989586621681046830"><span class="hs-identifier hs-var">platform</span></a></span></span><span> </span><span id="local-6989586621681046829"><span class="annot"><span class="annottext">ProcPointSet
</span><a href="#local-6989586621681046829"><span class="hs-identifier hs-var">callProcPoints</span></a></span></span><span> </span><span id="local-6989586621681046828"><span class="annot"><span class="annottext">CmmGraph
</span><a href="#local-6989586621681046828"><span class="hs-identifier hs-var">g</span></a></span></span><span>
</span><span id="line-194"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Platform
-&gt; CmmGraph
-&gt; [Block CmmNode C C]
-&gt; ProcPointSet
-&gt; UniqSM ProcPointSet
</span><a href="GHC.Cmm.ProcPoint.html#extendPPSet"><span class="hs-identifier hs-var">extendPPSet</span></a></span><span> </span><span class="annot"><span class="annottext">Platform
</span><a href="#local-6989586621681046830"><span class="hs-identifier hs-var">platform</span></a></span><span> </span><span class="annot"><span class="annottext">CmmGraph
</span><a href="#local-6989586621681046828"><span class="hs-identifier hs-var">g</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">CmmGraph -&gt; [Block CmmNode C C]
</span><a href="GHC.Cmm.Utils.html#revPostorder"><span class="hs-identifier hs-var">revPostorder</span></a></span><span> </span><span class="annot"><span class="annottext">CmmGraph
</span><a href="#local-6989586621681046828"><span class="hs-identifier hs-var">g</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">ProcPointSet
</span><a href="#local-6989586621681046829"><span class="hs-identifier hs-var">callProcPoints</span></a></span><span>
</span><span id="line-195"></span><span>
</span><span id="line-196"></span><span class="annot"><a href="GHC.Cmm.ProcPoint.html#extendPPSet"><span class="hs-identifier hs-type">extendPPSet</span></a></span><span>
</span><span id="line-197"></span><span>    </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../ghc-boot/src/GHC.Platform.html#Platform"><span class="hs-identifier hs-type">Platform</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Cmm.html#CmmGraph"><span class="hs-identifier hs-type">CmmGraph</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Cmm.html#CmmBlock"><span class="hs-identifier hs-type">CmmBlock</span></a></span><span class="hs-special">]</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Cmm.ProcPoint.html#ProcPointSet"><span class="hs-identifier hs-type">ProcPointSet</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Types.Unique.Supply.html#UniqSM"><span class="hs-identifier hs-type">UniqSM</span></a></span><span> </span><span class="annot"><a href="GHC.Cmm.ProcPoint.html#ProcPointSet"><span class="hs-identifier hs-type">ProcPointSet</span></a></span><span>
</span><span id="line-198"></span><span id="extendPPSet"><span class="annot"><span class="annottext">extendPPSet :: Platform
-&gt; CmmGraph
-&gt; [Block CmmNode C C]
-&gt; ProcPointSet
-&gt; UniqSM ProcPointSet
</span><a href="GHC.Cmm.ProcPoint.html#extendPPSet"><span class="hs-identifier hs-var hs-var">extendPPSet</span></a></span></span><span> </span><span id="local-6989586621681046825"><span class="annot"><span class="annottext">Platform
</span><a href="#local-6989586621681046825"><span class="hs-identifier hs-var">platform</span></a></span></span><span> </span><span id="local-6989586621681046824"><span class="annot"><span class="annottext">CmmGraph
</span><a href="#local-6989586621681046824"><span class="hs-identifier hs-var">g</span></a></span></span><span> </span><span id="local-6989586621681046823"><span class="annot"><span class="annottext">[Block CmmNode C C]
</span><a href="#local-6989586621681046823"><span class="hs-identifier hs-var">blocks</span></a></span></span><span> </span><span id="local-6989586621681046822"><span class="annot"><span class="annottext">ProcPointSet
</span><a href="#local-6989586621681046822"><span class="hs-identifier hs-var">procPoints</span></a></span></span><span> </span><span class="hs-glyph">=</span><span>
</span><span id="line-199"></span><span>    </span><span class="hs-keyword">let</span><span> </span><span id="local-6989586621681046821"><span class="annot"><span class="annottext">env :: LabelMap Status
</span><a href="#local-6989586621681046821"><span class="hs-identifier hs-var hs-var">env</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">ProcPointSet -&gt; CmmGraph -&gt; LabelMap Status
</span><a href="GHC.Cmm.ProcPoint.html#procPointAnalysis"><span class="hs-identifier hs-var">procPointAnalysis</span></a></span><span> </span><span class="annot"><span class="annottext">ProcPointSet
</span><a href="#local-6989586621681046822"><span class="hs-identifier hs-var">procPoints</span></a></span><span> </span><span class="annot"><span class="annottext">CmmGraph
</span><a href="#local-6989586621681046824"><span class="hs-identifier hs-var">g</span></a></span><span>
</span><span id="line-200"></span><span>        </span><span id="local-6989586621681046820"><span class="annot"><span class="annottext">add :: ProcPointSet -&gt; Block CmmNode C C -&gt; ProcPointSet
</span><a href="#local-6989586621681046820"><span class="hs-identifier hs-var hs-var">add</span></a></span></span><span> </span><span id="local-6989586621681046819"><span class="annot"><span class="annottext">ProcPointSet
</span><a href="#local-6989586621681046819"><span class="hs-identifier hs-var">pps</span></a></span></span><span> </span><span id="local-6989586621681046818"><span class="annot"><span class="annottext">Block CmmNode C C
</span><a href="#local-6989586621681046818"><span class="hs-identifier hs-var">block</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">let</span><span> </span><span id="local-6989586621681046817"><span class="annot"><span class="annottext">id :: BlockId
</span><a href="#local-6989586621681046817"><span class="hs-identifier hs-var hs-var">id</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Block CmmNode C C -&gt; BlockId
forall (thing :: Extensibility -&gt; Extensibility -&gt; *)
       (x :: Extensibility).
NonLocal thing =&gt;
thing C x -&gt; BlockId
</span><a href="GHC.Cmm.Dataflow.Graph.html#entryLabel"><span class="hs-identifier hs-var">entryLabel</span></a></span><span> </span><span class="annot"><span class="annottext">Block CmmNode C C
</span><a href="#local-6989586621681046818"><span class="hs-identifier hs-var">block</span></a></span><span>
</span><span id="line-201"></span><span>                        </span><span class="hs-keyword">in</span><span>  </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">KeyOf LabelMap -&gt; LabelMap Status -&gt; Maybe Status
forall (map :: * -&gt; *) a.
IsMap map =&gt;
KeyOf map -&gt; map a -&gt; Maybe a
</span><a href="GHC.Cmm.Dataflow.Collections.html#mapLookup"><span class="hs-identifier hs-var">mapLookup</span></a></span><span> </span><span class="annot"><span class="annottext">KeyOf LabelMap
BlockId
</span><a href="#local-6989586621681046817"><span class="hs-identifier hs-var">id</span></a></span><span> </span><span class="annot"><span class="annottext">LabelMap Status
</span><a href="#local-6989586621681046821"><span class="hs-identifier hs-var">env</span></a></span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-202"></span><span>                              </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-type">Just</span></a></span><span> </span><span class="annot"><span class="annottext">Status
</span><a href="GHC.Cmm.ProcPoint.html#ProcPoint"><span class="hs-identifier hs-var">ProcPoint</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">ElemOf ProcPointSet -&gt; ProcPointSet -&gt; ProcPointSet
forall set. IsSet set =&gt; ElemOf set -&gt; set -&gt; set
</span><a href="GHC.Cmm.Dataflow.Collections.html#setInsert"><span class="hs-identifier hs-var">setInsert</span></a></span><span> </span><span class="annot"><span class="annottext">ElemOf ProcPointSet
BlockId
</span><a href="#local-6989586621681046817"><span class="hs-identifier hs-var">id</span></a></span><span> </span><span class="annot"><span class="annottext">ProcPointSet
</span><a href="#local-6989586621681046819"><span class="hs-identifier hs-var">pps</span></a></span><span>
</span><span id="line-203"></span><span>                              </span><span class="annot"><span class="annottext">Maybe Status
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">ProcPointSet
</span><a href="#local-6989586621681046819"><span class="hs-identifier hs-var">pps</span></a></span><span>
</span><span id="line-204"></span><span>        </span><span id="local-6989586621681046815"><span class="annot"><span class="annottext">procPoints' :: ProcPointSet
</span><a href="#local-6989586621681046815"><span class="hs-identifier hs-var hs-var">procPoints'</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(ProcPointSet -&gt; Block CmmNode C C -&gt; ProcPointSet)
-&gt; ProcPointSet -&gt; CmmGraph -&gt; ProcPointSet
forall a. (a -&gt; Block CmmNode C C -&gt; a) -&gt; a -&gt; CmmGraph -&gt; a
</span><a href="GHC.Cmm.Utils.html#foldlGraphBlocks"><span class="hs-identifier hs-var">foldlGraphBlocks</span></a></span><span> </span><span class="annot"><span class="annottext">ProcPointSet -&gt; Block CmmNode C C -&gt; ProcPointSet
</span><a href="#local-6989586621681046820"><span class="hs-identifier hs-var">add</span></a></span><span> </span><span class="annot"><span class="annottext">ProcPointSet
forall set. IsSet set =&gt; set
</span><a href="GHC.Cmm.Dataflow.Collections.html#setEmpty"><span class="hs-identifier hs-var">setEmpty</span></a></span><span> </span><span class="annot"><span class="annottext">CmmGraph
</span><a href="#local-6989586621681046824"><span class="hs-identifier hs-var">g</span></a></span><span>
</span><span id="line-205"></span><span>        </span><span id="local-6989586621681046814"><span class="annot"><span class="annottext">newPoints :: [BlockId]
</span><a href="#local-6989586621681046814"><span class="hs-identifier hs-var hs-var">newPoints</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(Block CmmNode C C -&gt; Maybe BlockId)
-&gt; [Block CmmNode C C] -&gt; [BlockId]
forall a b. (a -&gt; Maybe b) -&gt; [a] -&gt; [b]
</span><a href="../../base/src/Data.Maybe.html#mapMaybe"><span class="hs-identifier hs-var">mapMaybe</span></a></span><span> </span><span class="annot"><span class="annottext">Block CmmNode C C -&gt; Maybe BlockId
</span><a href="#local-6989586621681046812"><span class="hs-identifier hs-var">ppSuccessor</span></a></span><span> </span><span class="annot"><span class="annottext">[Block CmmNode C C]
</span><a href="#local-6989586621681046823"><span class="hs-identifier hs-var">blocks</span></a></span><span>
</span><span id="line-206"></span><span>        </span><span id="local-6989586621681046811"><span class="annot"><span class="annottext">newPoint :: Maybe BlockId
</span><a href="#local-6989586621681046811"><span class="hs-identifier hs-var hs-var">newPoint</span></a></span></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[BlockId] -&gt; Maybe BlockId
forall a. [a] -&gt; Maybe a
</span><a href="../../base/src/Data.Maybe.html#listToMaybe"><span class="hs-identifier hs-var">listToMaybe</span></a></span><span> </span><span class="annot"><span class="annottext">[BlockId]
</span><a href="#local-6989586621681046814"><span class="hs-identifier hs-var">newPoints</span></a></span><span>
</span><span id="line-207"></span><span>        </span><span id="local-6989586621681046812"><span class="annot"><span class="annottext">ppSuccessor :: Block CmmNode C C -&gt; Maybe BlockId
</span><a href="#local-6989586621681046812"><span class="hs-identifier hs-var hs-var">ppSuccessor</span></a></span></span><span> </span><span id="local-6989586621681046809"><span class="annot"><span class="annottext">Block CmmNode C C
</span><a href="#local-6989586621681046809"><span class="hs-identifier hs-var">b</span></a></span></span><span> </span><span class="hs-glyph">=</span><span>
</span><span id="line-208"></span><span>            </span><span class="hs-keyword">let</span><span> </span><span id="local-6989586621681046808"><span class="annot"><span class="annottext">nreached :: BlockId -&gt; Int
</span><a href="#local-6989586621681046808"><span class="hs-identifier hs-var hs-var">nreached</span></a></span></span><span> </span><span id="local-6989586621681046807"><span class="annot"><span class="annottext">BlockId
</span><a href="#local-6989586621681046807"><span class="hs-identifier hs-var">id</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">KeyOf LabelMap -&gt; LabelMap Status -&gt; Maybe Status
forall (map :: * -&gt; *) a.
IsMap map =&gt;
KeyOf map -&gt; map a -&gt; Maybe a
</span><a href="GHC.Cmm.Dataflow.Collections.html#mapLookup"><span class="hs-identifier hs-var">mapLookup</span></a></span><span> </span><span class="annot"><span class="annottext">KeyOf LabelMap
BlockId
</span><a href="#local-6989586621681046807"><span class="hs-identifier hs-var">id</span></a></span><span> </span><span class="annot"><span class="annottext">LabelMap Status
</span><a href="#local-6989586621681046821"><span class="hs-identifier hs-var">env</span></a></span><span> </span><span class="annot"><span class="annottext">Maybe Status -&gt; Status -&gt; Status
forall a. Maybe a -&gt; a -&gt; a
</span><a href="GHC.Data.Maybe.html#orElse"><span class="hs-operator hs-var">`orElse`</span></a></span><span>
</span><span id="line-209"></span><span>                                    </span><span class="annot"><span class="annottext">String -&gt; SDoc -&gt; Status
forall a. HasCallStack =&gt; String -&gt; SDoc -&gt; a
</span><a href="GHC.Utils.Outputable.html#pprPanic"><span class="hs-identifier hs-var">pprPanic</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;no ppt&quot;</span></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">BlockId -&gt; SDoc
forall a. Outputable a =&gt; a -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="annot"><span class="annottext">BlockId
</span><a href="#local-6989586621681046807"><span class="hs-identifier hs-var">id</span></a></span><span> </span><span class="annot"><span class="annottext">SDoc -&gt; SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#%3C%2B%3E"><span class="hs-operator hs-var">&lt;+&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">Block CmmNode C C -&gt; SDoc
forall a. Outputable a =&gt; a -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="annot"><span class="annottext">Block CmmNode C C
</span><a href="#local-6989586621681046809"><span class="hs-identifier hs-var">b</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-210"></span><span>                                </span><span class="annot"><span class="annottext">Status
</span><a href="GHC.Cmm.ProcPoint.html#ProcPoint"><span class="hs-identifier hs-var">ProcPoint</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">1</span></span><span>
</span><span id="line-211"></span><span>                                </span><span class="annot"><a href="GHC.Cmm.ProcPoint.html#ReachedBy"><span class="hs-identifier hs-type">ReachedBy</span></a></span><span> </span><span id="local-6989586621681046804"><span class="annot"><span class="annottext">ProcPointSet
</span><a href="#local-6989586621681046804"><span class="hs-identifier hs-var">ps</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">ProcPointSet -&gt; Int
forall set. IsSet set =&gt; set -&gt; Int
</span><a href="GHC.Cmm.Dataflow.Collections.html#setSize"><span class="hs-identifier hs-var">setSize</span></a></span><span> </span><span class="annot"><span class="annottext">ProcPointSet
</span><a href="#local-6989586621681046804"><span class="hs-identifier hs-var">ps</span></a></span><span>
</span><span id="line-212"></span><span>                </span><span id="local-6989586621681046803"><span class="annot"><span class="annottext">block_procpoints :: Int
</span><a href="#local-6989586621681046803"><span class="hs-identifier hs-var hs-var">block_procpoints</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">BlockId -&gt; Int
</span><a href="#local-6989586621681046808"><span class="hs-identifier hs-var">nreached</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Block CmmNode C C -&gt; BlockId
forall (thing :: Extensibility -&gt; Extensibility -&gt; *)
       (x :: Extensibility).
NonLocal thing =&gt;
thing C x -&gt; BlockId
</span><a href="GHC.Cmm.Dataflow.Graph.html#entryLabel"><span class="hs-identifier hs-var">entryLabel</span></a></span><span> </span><span class="annot"><span class="annottext">Block CmmNode C C
</span><a href="#local-6989586621681046809"><span class="hs-identifier hs-var">b</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-213"></span><span>                </span><span class="hs-comment">-- | Looking for a successor of b that is reached by</span><span>
</span><span id="line-214"></span><span>                </span><span class="hs-comment">-- more proc points than b and is not already a proc</span><span>
</span><span id="line-215"></span><span>                </span><span class="hs-comment">-- point.  If found, it can become a proc point.</span><span>
</span><span id="line-216"></span><span>                </span><span id="local-6989586621681046802"><span class="annot"><span class="annottext">newId :: BlockId -&gt; Bool
</span><a href="#local-6989586621681046802"><span class="hs-identifier hs-var hs-var">newId</span></a></span></span><span> </span><span id="local-6989586621681046801"><span class="annot"><span class="annottext">BlockId
</span><a href="#local-6989586621681046801"><span class="hs-identifier hs-var">succ_id</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Bool -&gt; Bool
</span><span class="hs-identifier hs-var">not</span></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">ElemOf ProcPointSet -&gt; ProcPointSet -&gt; Bool
forall set. IsSet set =&gt; ElemOf set -&gt; set -&gt; Bool
</span><a href="GHC.Cmm.Dataflow.Collections.html#setMember"><span class="hs-identifier hs-var">setMember</span></a></span><span> </span><span class="annot"><span class="annottext">ElemOf ProcPointSet
BlockId
</span><a href="#local-6989586621681046801"><span class="hs-identifier hs-var">succ_id</span></a></span><span> </span><span class="annot"><span class="annottext">ProcPointSet
</span><a href="#local-6989586621681046815"><span class="hs-identifier hs-var">procPoints'</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">Bool -&gt; Bool -&gt; Bool
</span><span class="hs-operator hs-var">&amp;&amp;</span></span><span>
</span><span id="line-217"></span><span>                                </span><span class="annot"><span class="annottext">BlockId -&gt; Int
</span><a href="#local-6989586621681046808"><span class="hs-identifier hs-var">nreached</span></a></span><span> </span><span class="annot"><span class="annottext">BlockId
</span><a href="#local-6989586621681046801"><span class="hs-identifier hs-var">succ_id</span></a></span><span> </span><span class="annot"><span class="annottext">Int -&gt; Int -&gt; Bool
forall a. Ord a =&gt; a -&gt; a -&gt; Bool
</span><span class="hs-operator hs-var">&gt;</span></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621681046803"><span class="hs-identifier hs-var">block_procpoints</span></a></span><span>
</span><span id="line-218"></span><span>            </span><span class="hs-keyword">in</span><span>  </span><span class="annot"><span class="annottext">[BlockId] -&gt; Maybe BlockId
forall a. [a] -&gt; Maybe a
</span><a href="../../base/src/Data.Maybe.html#listToMaybe"><span class="hs-identifier hs-var">listToMaybe</span></a></span><span> </span><span class="annot"><span class="annottext">([BlockId] -&gt; Maybe BlockId) -&gt; [BlockId] -&gt; Maybe BlockId
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">(BlockId -&gt; Bool) -&gt; [BlockId] -&gt; [BlockId]
forall a. (a -&gt; Bool) -&gt; [a] -&gt; [a]
</span><a href="../../base/src/GHC.List.html#filter"><span class="hs-identifier hs-var">filter</span></a></span><span> </span><span class="annot"><span class="annottext">BlockId -&gt; Bool
</span><a href="#local-6989586621681046802"><span class="hs-identifier hs-var">newId</span></a></span><span> </span><span class="annot"><span class="annottext">([BlockId] -&gt; [BlockId]) -&gt; [BlockId] -&gt; [BlockId]
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">Block CmmNode C C -&gt; [BlockId]
forall (thing :: Extensibility -&gt; Extensibility -&gt; *)
       (e :: Extensibility).
NonLocal thing =&gt;
thing e C -&gt; [BlockId]
</span><a href="GHC.Cmm.Dataflow.Graph.html#successors"><span class="hs-identifier hs-var">successors</span></a></span><span> </span><span class="annot"><span class="annottext">Block CmmNode C C
</span><a href="#local-6989586621681046809"><span class="hs-identifier hs-var">b</span></a></span><span>
</span><span id="line-219"></span><span>
</span><span id="line-220"></span><span>    </span><span class="hs-keyword">in</span><span> </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">Maybe BlockId
</span><a href="#local-6989586621681046811"><span class="hs-identifier hs-var">newPoint</span></a></span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-221"></span><span>         </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-type">Just</span></a></span><span> </span><span id="local-6989586621681046798"><span class="annot"><span class="annottext">BlockId
</span><a href="#local-6989586621681046798"><span class="hs-identifier hs-var">id</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span>
</span><span id="line-222"></span><span>             </span><span class="hs-keyword">if</span><span> </span><span class="annot"><span class="annottext">ElemOf ProcPointSet -&gt; ProcPointSet -&gt; Bool
forall set. IsSet set =&gt; ElemOf set -&gt; set -&gt; Bool
</span><a href="GHC.Cmm.Dataflow.Collections.html#setMember"><span class="hs-identifier hs-var">setMember</span></a></span><span> </span><span class="annot"><span class="annottext">ElemOf ProcPointSet
BlockId
</span><a href="#local-6989586621681046798"><span class="hs-identifier hs-var">id</span></a></span><span> </span><span class="annot"><span class="annottext">ProcPointSet
</span><a href="#local-6989586621681046815"><span class="hs-identifier hs-var">procPoints'</span></a></span><span>
</span><span id="line-223"></span><span>                </span><span class="hs-keyword">then</span><span> </span><span class="annot"><span class="annottext">String -&gt; UniqSM ProcPointSet
forall a. String -&gt; a
</span><a href="GHC.Utils.Panic.Plain.html#panic"><span class="hs-identifier hs-var">panic</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;added old proc pt&quot;</span></span><span>
</span><span id="line-224"></span><span>                </span><span class="hs-keyword">else</span><span> </span><span class="annot"><span class="annottext">Platform
-&gt; CmmGraph
-&gt; [Block CmmNode C C]
-&gt; ProcPointSet
-&gt; UniqSM ProcPointSet
</span><a href="GHC.Cmm.ProcPoint.html#extendPPSet"><span class="hs-identifier hs-var">extendPPSet</span></a></span><span> </span><span class="annot"><span class="annottext">Platform
</span><a href="#local-6989586621681046825"><span class="hs-identifier hs-var">platform</span></a></span><span> </span><span class="annot"><span class="annottext">CmmGraph
</span><a href="#local-6989586621681046824"><span class="hs-identifier hs-var">g</span></a></span><span> </span><span class="annot"><span class="annottext">[Block CmmNode C C]
</span><a href="#local-6989586621681046823"><span class="hs-identifier hs-var">blocks</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">ElemOf ProcPointSet -&gt; ProcPointSet -&gt; ProcPointSet
forall set. IsSet set =&gt; ElemOf set -&gt; set -&gt; set
</span><a href="GHC.Cmm.Dataflow.Collections.html#setInsert"><span class="hs-identifier hs-var">setInsert</span></a></span><span> </span><span class="annot"><span class="annottext">ElemOf ProcPointSet
BlockId
</span><a href="#local-6989586621681046798"><span class="hs-identifier hs-var">id</span></a></span><span> </span><span class="annot"><span class="annottext">ProcPointSet
</span><a href="#local-6989586621681046815"><span class="hs-identifier hs-var">procPoints'</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-225"></span><span>         </span><span class="annot"><span class="annottext">Maybe BlockId
</span><a href="../../base/src/GHC.Maybe.html#Nothing"><span class="hs-identifier hs-var">Nothing</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">ProcPointSet -&gt; UniqSM ProcPointSet
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="annot"><span class="annottext">ProcPointSet
</span><a href="#local-6989586621681046815"><span class="hs-identifier hs-var">procPoints'</span></a></span><span>
</span><span id="line-226"></span><span>
</span><span id="line-227"></span><span>
</span><span id="line-228"></span><span class="hs-comment">-- At this point, we have found a set of procpoints, each of which should be</span><span>
</span><span id="line-229"></span><span class="hs-comment">-- the entry point of a procedure.</span><span>
</span><span id="line-230"></span><span class="hs-comment">-- Now, we create the procedure for each proc point,</span><span>
</span><span id="line-231"></span><span class="hs-comment">-- which requires that we:</span><span>
</span><span id="line-232"></span><span class="hs-comment">-- 1. build a map from proc points to the blocks reachable from the proc point</span><span>
</span><span id="line-233"></span><span class="hs-comment">-- 2. turn each branch to a proc point into a jump</span><span>
</span><span id="line-234"></span><span class="hs-comment">-- 3. turn calls and returns into jumps</span><span>
</span><span id="line-235"></span><span class="hs-comment">-- 4. build info tables for the procedures -- and update the info table for</span><span>
</span><span id="line-236"></span><span class="hs-comment">--    the SRTs in the entry procedure as well.</span><span>
</span><span id="line-237"></span><span class="hs-comment">-- Input invariant: A block should only be reachable from a single ProcPoint.</span><span>
</span><span id="line-238"></span><span class="hs-comment">-- ToDo: use the _ret naming convention that the old code generator</span><span>
</span><span id="line-239"></span><span class="hs-comment">-- used. -- EZY</span><span>
</span><span id="line-240"></span><span class="annot"><a href="GHC.Cmm.ProcPoint.html#splitAtProcPoints"><span class="hs-identifier hs-type">splitAtProcPoints</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Driver.Session.html#DynFlags"><span class="hs-identifier hs-type">DynFlags</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Cmm.CLabel.html#CLabel"><span class="hs-identifier hs-type">CLabel</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Cmm.ProcPoint.html#ProcPointSet"><span class="hs-identifier hs-type">ProcPointSet</span></a></span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Cmm.ProcPoint.html#ProcPointSet"><span class="hs-identifier hs-type">ProcPointSet</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Cmm.Dataflow.Label.html#LabelMap"><span class="hs-identifier hs-type">LabelMap</span></a></span><span> </span><span class="annot"><a href="GHC.Cmm.ProcPoint.html#Status"><span class="hs-identifier hs-type">Status</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span>
</span><span id="line-241"></span><span>                     </span><span class="annot"><a href="GHC.Cmm.html#CmmDecl"><span class="hs-identifier hs-type">CmmDecl</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Types.Unique.Supply.html#UniqSM"><span class="hs-identifier hs-type">UniqSM</span></a></span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Cmm.html#CmmDecl"><span class="hs-identifier hs-type">CmmDecl</span></a></span><span class="hs-special">]</span><span>
</span><span id="line-242"></span><span id="splitAtProcPoints"><span class="annot"><span class="annottext">splitAtProcPoints :: DynFlags
-&gt; CLabel
-&gt; ProcPointSet
-&gt; ProcPointSet
-&gt; LabelMap Status
-&gt; CmmDecl
-&gt; UniqSM [CmmDecl]
</span><a href="GHC.Cmm.ProcPoint.html#splitAtProcPoints"><span class="hs-identifier hs-var hs-var">splitAtProcPoints</span></a></span></span><span> </span><span id="local-6989586621681046796"><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621681046796"><span class="hs-identifier hs-var">dflags</span></a></span></span><span> </span><span id="local-6989586621681046795"><span class="annot"><span class="annottext">CLabel
</span><a href="#local-6989586621681046795"><span class="hs-identifier hs-var">entry_label</span></a></span></span><span> </span><span id="local-6989586621681046794"><span class="annot"><span class="annottext">ProcPointSet
</span><a href="#local-6989586621681046794"><span class="hs-identifier hs-var">callPPs</span></a></span></span><span> </span><span id="local-6989586621681046793"><span class="annot"><span class="annottext">ProcPointSet
</span><a href="#local-6989586621681046793"><span class="hs-identifier hs-var">procPoints</span></a></span></span><span> </span><span id="local-6989586621681046792"><span class="annot"><span class="annottext">LabelMap Status
</span><a href="#local-6989586621681046792"><span class="hs-identifier hs-var">procMap</span></a></span></span><span>
</span><span id="line-243"></span><span>                  </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Cmm.html#CmmProc"><span class="hs-identifier hs-type">CmmProc</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Cmm.html#TopInfo"><span class="hs-identifier hs-type">TopInfo</span></a></span><span> </span><span class="hs-special">{</span><span class="annot"><span class="annottext">info_tbls :: CmmTopInfo -&gt; LabelMap CmmInfoTable
</span><a href="GHC.Cmm.html#info_tbls"><span class="hs-identifier hs-var">info_tbls</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span id="local-6989586621681046788"><span class="annot"><span class="annottext">LabelMap CmmInfoTable
</span><a href="#local-6989586621681046788"><span class="hs-identifier hs-var">info_tbls</span></a></span></span><span class="hs-special">}</span><span class="hs-special">)</span><span>
</span><span id="line-244"></span><span>                           </span><span id="local-6989586621681046787"><span class="annot"><span class="annottext">CLabel
</span><a href="#local-6989586621681046787"><span class="hs-identifier hs-var">top_l</span></a></span></span><span> </span><span class="annot"><span class="annottext">[GlobalReg]
</span><span class="hs-identifier">_</span></span><span> </span><span id="local-6989586621681046786"><span class="annot"><span class="annottext">g :: CmmGraph
</span><a href="#local-6989586621681046786"><span class="hs-identifier hs-var">g</span></a></span></span><span class="hs-glyph">@</span><span class="hs-special">(</span><span class="annot"><a href="GHC.Cmm.html#CmmGraph"><span class="hs-identifier hs-type">CmmGraph</span></a></span><span> </span><span class="hs-special">{</span><span class="annot"><span class="annottext">g_entry :: forall (n :: Extensibility -&gt; Extensibility -&gt; *).
GenCmmGraph n -&gt; BlockId
</span><a href="GHC.Cmm.html#g_entry"><span class="hs-identifier hs-var">g_entry</span></a></span><span class="hs-glyph">=</span><span id="local-6989586621681046785"><span class="annot"><span class="annottext">BlockId
</span><a href="#local-6989586621681046785"><span class="hs-identifier hs-var">entry</span></a></span></span><span class="hs-special">}</span><span class="hs-special">)</span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span>
</span><span id="line-245"></span><span>  </span><span class="hs-keyword">do</span><span> </span><span class="hs-comment">-- Build a map from procpoints to the blocks they reach</span><span>
</span><span id="line-246"></span><span>     </span><span class="hs-keyword">let</span><span> </span><span class="annot"><a href="#local-6989586621681046784"><span class="hs-identifier hs-type">add_block</span></a></span><span>
</span><span id="line-247"></span><span>             </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Cmm.Dataflow.Label.html#LabelMap"><span class="hs-identifier hs-type">LabelMap</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Cmm.Dataflow.Label.html#LabelMap"><span class="hs-identifier hs-type">LabelMap</span></a></span><span> </span><span class="annot"><a href="GHC.Cmm.html#CmmBlock"><span class="hs-identifier hs-type">CmmBlock</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-248"></span><span>             </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Cmm.html#CmmBlock"><span class="hs-identifier hs-type">CmmBlock</span></a></span><span>
</span><span id="line-249"></span><span>             </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Cmm.Dataflow.Label.html#LabelMap"><span class="hs-identifier hs-type">LabelMap</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Cmm.Dataflow.Label.html#LabelMap"><span class="hs-identifier hs-type">LabelMap</span></a></span><span> </span><span class="annot"><a href="GHC.Cmm.html#CmmBlock"><span class="hs-identifier hs-type">CmmBlock</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-250"></span><span>         </span><span id="local-6989586621681046784"><span class="annot"><span class="annottext">add_block :: LabelMap (LabelMap (Block CmmNode C C))
-&gt; Block CmmNode C C -&gt; LabelMap (LabelMap (Block CmmNode C C))
</span><a href="#local-6989586621681046784"><span class="hs-identifier hs-var hs-var">add_block</span></a></span></span><span> </span><span id="local-6989586621681046783"><span class="annot"><span class="annottext">LabelMap (LabelMap (Block CmmNode C C))
</span><a href="#local-6989586621681046783"><span class="hs-identifier hs-var">graphEnv</span></a></span></span><span> </span><span id="local-6989586621681046782"><span class="annot"><span class="annottext">Block CmmNode C C
</span><a href="#local-6989586621681046782"><span class="hs-identifier hs-var">b</span></a></span></span><span> </span><span class="hs-glyph">=</span><span>
</span><span id="line-251"></span><span>           </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">KeyOf LabelMap -&gt; LabelMap Status -&gt; Maybe Status
forall (map :: * -&gt; *) a.
IsMap map =&gt;
KeyOf map -&gt; map a -&gt; Maybe a
</span><a href="GHC.Cmm.Dataflow.Collections.html#mapLookup"><span class="hs-identifier hs-var">mapLookup</span></a></span><span> </span><span class="annot"><span class="annottext">KeyOf LabelMap
BlockId
</span><a href="#local-6989586621681046781"><span class="hs-identifier hs-var">bid</span></a></span><span> </span><span class="annot"><span class="annottext">LabelMap Status
</span><a href="#local-6989586621681046792"><span class="hs-identifier hs-var">procMap</span></a></span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-252"></span><span>             </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-type">Just</span></a></span><span> </span><span class="annot"><span class="annottext">Status
</span><a href="GHC.Cmm.ProcPoint.html#ProcPoint"><span class="hs-identifier hs-var">ProcPoint</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">LabelMap (LabelMap (Block CmmNode C C))
-&gt; KeyOf LabelMap
-&gt; KeyOf LabelMap
-&gt; Block CmmNode C C
-&gt; LabelMap (LabelMap (Block CmmNode C C))
forall {map :: * -&gt; *} {map :: * -&gt; *} {a}.
(IsMap map, IsMap map) =&gt;
map (map a) -&gt; KeyOf map -&gt; KeyOf map -&gt; a -&gt; map (map a)
</span><a href="#local-6989586621681046780"><span class="hs-identifier hs-var">add</span></a></span><span> </span><span class="annot"><span class="annottext">LabelMap (LabelMap (Block CmmNode C C))
</span><a href="#local-6989586621681046783"><span class="hs-identifier hs-var">graphEnv</span></a></span><span> </span><span class="annot"><span class="annottext">KeyOf LabelMap
BlockId
</span><a href="#local-6989586621681046781"><span class="hs-identifier hs-var">bid</span></a></span><span> </span><span class="annot"><span class="annottext">KeyOf LabelMap
BlockId
</span><a href="#local-6989586621681046781"><span class="hs-identifier hs-var">bid</span></a></span><span> </span><span class="annot"><span class="annottext">Block CmmNode C C
</span><a href="#local-6989586621681046782"><span class="hs-identifier hs-var">b</span></a></span><span>
</span><span id="line-253"></span><span>             </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-type">Just</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Cmm.ProcPoint.html#ReachedBy"><span class="hs-identifier hs-type">ReachedBy</span></a></span><span> </span><span id="local-6989586621681046779"><span class="annot"><span class="annottext">ProcPointSet
</span><a href="#local-6989586621681046779"><span class="hs-identifier hs-var">set</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span>
</span><span id="line-254"></span><span>               </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">ProcPointSet -&gt; [ElemOf ProcPointSet]
forall set. IsSet set =&gt; set -&gt; [ElemOf set]
</span><a href="GHC.Cmm.Dataflow.Collections.html#setElems"><span class="hs-identifier hs-var">setElems</span></a></span><span> </span><span class="annot"><span class="annottext">ProcPointSet
</span><a href="#local-6989586621681046779"><span class="hs-identifier hs-var">set</span></a></span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-255"></span><span>                 </span><span class="hs-special">[</span><span class="hs-special">]</span><span>   </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">LabelMap (LabelMap (Block CmmNode C C))
</span><a href="#local-6989586621681046783"><span class="hs-identifier hs-var">graphEnv</span></a></span><span>
</span><span id="line-256"></span><span>                 </span><span class="hs-special">[</span><span id="local-6989586621681046778"><span class="annot"><span class="annottext">ElemOf ProcPointSet
</span><a href="#local-6989586621681046778"><span class="hs-identifier hs-var">id</span></a></span></span><span class="hs-special">]</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">LabelMap (LabelMap (Block CmmNode C C))
-&gt; KeyOf LabelMap
-&gt; KeyOf LabelMap
-&gt; Block CmmNode C C
-&gt; LabelMap (LabelMap (Block CmmNode C C))
forall {map :: * -&gt; *} {map :: * -&gt; *} {a}.
(IsMap map, IsMap map) =&gt;
map (map a) -&gt; KeyOf map -&gt; KeyOf map -&gt; a -&gt; map (map a)
</span><a href="#local-6989586621681046780"><span class="hs-identifier hs-var">add</span></a></span><span> </span><span class="annot"><span class="annottext">LabelMap (LabelMap (Block CmmNode C C))
</span><a href="#local-6989586621681046783"><span class="hs-identifier hs-var">graphEnv</span></a></span><span> </span><span class="annot"><span class="annottext">KeyOf LabelMap
ElemOf ProcPointSet
</span><a href="#local-6989586621681046778"><span class="hs-identifier hs-var">id</span></a></span><span> </span><span class="annot"><span class="annottext">KeyOf LabelMap
BlockId
</span><a href="#local-6989586621681046781"><span class="hs-identifier hs-var">bid</span></a></span><span> </span><span class="annot"><span class="annottext">Block CmmNode C C
</span><a href="#local-6989586621681046782"><span class="hs-identifier hs-var">b</span></a></span><span>
</span><span id="line-257"></span><span>                 </span><span class="annot"><span class="annottext">[ElemOf ProcPointSet]
</span><span class="hs-identifier">_</span></span><span>    </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">String -&gt; LabelMap (LabelMap (Block CmmNode C C))
forall a. String -&gt; a
</span><a href="GHC.Utils.Panic.Plain.html#panic"><span class="hs-identifier hs-var">panic</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;Each block should be reachable from only one ProcPoint&quot;</span></span><span>
</span><span id="line-258"></span><span>             </span><span class="annot"><span class="annottext">Maybe Status
</span><a href="../../base/src/GHC.Maybe.html#Nothing"><span class="hs-identifier hs-var">Nothing</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">LabelMap (LabelMap (Block CmmNode C C))
</span><a href="#local-6989586621681046783"><span class="hs-identifier hs-var">graphEnv</span></a></span><span>
</span><span id="line-259"></span><span>           </span><span class="hs-keyword">where</span><span> </span><span id="local-6989586621681046781"><span class="annot"><span class="annottext">bid :: BlockId
</span><a href="#local-6989586621681046781"><span class="hs-identifier hs-var hs-var">bid</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Block CmmNode C C -&gt; BlockId
forall (thing :: Extensibility -&gt; Extensibility -&gt; *)
       (x :: Extensibility).
NonLocal thing =&gt;
thing C x -&gt; BlockId
</span><a href="GHC.Cmm.Dataflow.Graph.html#entryLabel"><span class="hs-identifier hs-var">entryLabel</span></a></span><span> </span><span class="annot"><span class="annottext">Block CmmNode C C
</span><a href="#local-6989586621681046782"><span class="hs-identifier hs-var">b</span></a></span><span>
</span><span id="line-260"></span><span>         </span><span id="local-6989586621681046780"><span class="annot"><span class="annottext">add :: map (map a) -&gt; KeyOf map -&gt; KeyOf map -&gt; a -&gt; map (map a)
</span><a href="#local-6989586621681046780"><span class="hs-identifier hs-var hs-var">add</span></a></span></span><span> </span><span id="local-6989586621681046771"><span class="annot"><span class="annottext">map (map a)
</span><a href="#local-6989586621681046771"><span class="hs-identifier hs-var">graphEnv</span></a></span></span><span> </span><span id="local-6989586621681046770"><span class="annot"><span class="annottext">KeyOf map
</span><a href="#local-6989586621681046770"><span class="hs-identifier hs-var">procId</span></a></span></span><span> </span><span id="local-6989586621681046769"><span class="annot"><span class="annottext">KeyOf map
</span><a href="#local-6989586621681046769"><span class="hs-identifier hs-var">bid</span></a></span></span><span> </span><span id="local-6989586621681046768"><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621681046768"><span class="hs-identifier hs-var">b</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">KeyOf map -&gt; map a -&gt; map (map a) -&gt; map (map a)
forall (map :: * -&gt; *) a.
IsMap map =&gt;
KeyOf map -&gt; a -&gt; map a -&gt; map a
</span><a href="GHC.Cmm.Dataflow.Collections.html#mapInsert"><span class="hs-identifier hs-var">mapInsert</span></a></span><span> </span><span class="annot"><span class="annottext">KeyOf map
</span><a href="#local-6989586621681046770"><span class="hs-identifier hs-var">procId</span></a></span><span> </span><span class="annot"><span class="annottext">map a
</span><a href="#local-6989586621681046766"><span class="hs-identifier hs-var">graph'</span></a></span><span> </span><span class="annot"><span class="annottext">map (map a)
</span><a href="#local-6989586621681046771"><span class="hs-identifier hs-var">graphEnv</span></a></span><span>
</span><span id="line-261"></span><span>               </span><span class="hs-keyword">where</span><span> </span><span id="local-6989586621681046765"><span class="annot"><span class="annottext">graph :: map a
</span><a href="#local-6989586621681046765"><span class="hs-identifier hs-var hs-var">graph</span></a></span></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">KeyOf map -&gt; map (map a) -&gt; Maybe (map a)
forall (map :: * -&gt; *) a.
IsMap map =&gt;
KeyOf map -&gt; map a -&gt; Maybe a
</span><a href="GHC.Cmm.Dataflow.Collections.html#mapLookup"><span class="hs-identifier hs-var">mapLookup</span></a></span><span> </span><span class="annot"><span class="annottext">KeyOf map
</span><a href="#local-6989586621681046770"><span class="hs-identifier hs-var">procId</span></a></span><span> </span><span class="annot"><span class="annottext">map (map a)
</span><a href="#local-6989586621681046771"><span class="hs-identifier hs-var">graphEnv</span></a></span><span> </span><span class="annot"><span class="annottext">Maybe (map a) -&gt; map a -&gt; map a
forall a. Maybe a -&gt; a -&gt; a
</span><a href="GHC.Data.Maybe.html#orElse"><span class="hs-operator hs-var">`orElse`</span></a></span><span> </span><span class="annot"><span class="annottext">map a
forall (map :: * -&gt; *) a. IsMap map =&gt; map a
</span><a href="GHC.Cmm.Dataflow.Collections.html#mapEmpty"><span class="hs-identifier hs-var">mapEmpty</span></a></span><span>
</span><span id="line-262"></span><span>                     </span><span id="local-6989586621681046766"><span class="annot"><span class="annottext">graph' :: map a
</span><a href="#local-6989586621681046766"><span class="hs-identifier hs-var hs-var">graph'</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">KeyOf map -&gt; a -&gt; map a -&gt; map a
forall (map :: * -&gt; *) a.
IsMap map =&gt;
KeyOf map -&gt; a -&gt; map a -&gt; map a
</span><a href="GHC.Cmm.Dataflow.Collections.html#mapInsert"><span class="hs-identifier hs-var">mapInsert</span></a></span><span> </span><span class="annot"><span class="annottext">KeyOf map
</span><a href="#local-6989586621681046769"><span class="hs-identifier hs-var">bid</span></a></span><span> </span><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621681046768"><span class="hs-identifier hs-var">b</span></a></span><span> </span><span class="annot"><span class="annottext">map a
</span><a href="#local-6989586621681046765"><span class="hs-identifier hs-var">graph</span></a></span><span>
</span><span id="line-263"></span><span>
</span><span id="line-264"></span><span>     </span><span class="hs-keyword">let</span><span> </span><span id="local-6989586621681046763"><span class="annot"><span class="annottext">liveness :: BlockEntryLiveness GlobalReg
</span><a href="#local-6989586621681046763"><span class="hs-identifier hs-var hs-var">liveness</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">DynFlags -&gt; CmmGraph -&gt; BlockEntryLiveness GlobalReg
</span><a href="GHC.Cmm.Liveness.html#cmmGlobalLiveness"><span class="hs-identifier hs-var">cmmGlobalLiveness</span></a></span><span> </span><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621681046796"><span class="hs-identifier hs-var">dflags</span></a></span><span> </span><span class="annot"><span class="annottext">CmmGraph
</span><a href="#local-6989586621681046786"><span class="hs-identifier hs-var">g</span></a></span><span>
</span><span id="line-265"></span><span>     </span><span class="hs-keyword">let</span><span> </span><span id="local-6989586621681046761"><span class="annot"><span class="annottext">ppLiveness :: BlockId -&gt; [GlobalReg]
</span><a href="#local-6989586621681046761"><span class="hs-identifier hs-var hs-var">ppLiveness</span></a></span></span><span> </span><span id="local-6989586621681046760"><span class="annot"><span class="annottext">BlockId
</span><a href="#local-6989586621681046760"><span class="hs-identifier hs-var">pp</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(GlobalReg -&gt; Bool) -&gt; [GlobalReg] -&gt; [GlobalReg]
forall a. (a -&gt; Bool) -&gt; [a] -&gt; [a]
</span><a href="../../base/src/GHC.List.html#filter"><span class="hs-identifier hs-var">filter</span></a></span><span> </span><span class="annot"><span class="annottext">GlobalReg -&gt; Bool
</span><a href="GHC.Cmm.Expr.html#isArgReg"><span class="hs-identifier hs-var">isArgReg</span></a></span><span> </span><span class="annot"><span class="annottext">([GlobalReg] -&gt; [GlobalReg]) -&gt; [GlobalReg] -&gt; [GlobalReg]
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span>
</span><span id="line-266"></span><span>                         </span><span class="annot"><span class="annottext">RegSet GlobalReg -&gt; [GlobalReg]
forall r. RegSet r -&gt; [r]
</span><a href="GHC.Cmm.Expr.html#regSetToList"><span class="hs-identifier hs-var">regSetToList</span></a></span><span> </span><span class="annot"><span class="annottext">(RegSet GlobalReg -&gt; [GlobalReg])
-&gt; RegSet GlobalReg -&gt; [GlobalReg]
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span>
</span><span id="line-267"></span><span>                         </span><span class="annot"><span class="annottext">String -&gt; Maybe (RegSet GlobalReg) -&gt; RegSet GlobalReg
forall a. HasCallStack =&gt; String -&gt; Maybe a -&gt; a
</span><a href="GHC.Data.Maybe.html#expectJust"><span class="hs-identifier hs-var">expectJust</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;ppLiveness&quot;</span></span><span> </span><span class="annot"><span class="annottext">(Maybe (RegSet GlobalReg) -&gt; RegSet GlobalReg)
-&gt; Maybe (RegSet GlobalReg) -&gt; RegSet GlobalReg
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">KeyOf LabelMap
-&gt; BlockEntryLiveness GlobalReg -&gt; Maybe (RegSet GlobalReg)
forall (map :: * -&gt; *) a.
IsMap map =&gt;
KeyOf map -&gt; map a -&gt; Maybe a
</span><a href="GHC.Cmm.Dataflow.Collections.html#mapLookup"><span class="hs-identifier hs-var">mapLookup</span></a></span><span> </span><span class="annot"><span class="annottext">KeyOf LabelMap
BlockId
</span><a href="#local-6989586621681046760"><span class="hs-identifier hs-var">pp</span></a></span><span> </span><span class="annot"><span class="annottext">BlockEntryLiveness GlobalReg
</span><a href="#local-6989586621681046763"><span class="hs-identifier hs-var">liveness</span></a></span><span>
</span><span id="line-268"></span><span>
</span><span id="line-269"></span><span>     </span><span id="local-6989586621681046756"><span class="annot"><span class="annottext">LabelMap (LabelMap (Block CmmNode C C))
</span><a href="#local-6989586621681046756"><span class="hs-identifier hs-var">graphEnv</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">LabelMap (LabelMap (Block CmmNode C C))
-&gt; UniqSM (LabelMap (LabelMap (Block CmmNode C C)))
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="annot"><span class="annottext">(LabelMap (LabelMap (Block CmmNode C C))
 -&gt; UniqSM (LabelMap (LabelMap (Block CmmNode C C))))
-&gt; LabelMap (LabelMap (Block CmmNode C C))
-&gt; UniqSM (LabelMap (LabelMap (Block CmmNode C C)))
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">(LabelMap (LabelMap (Block CmmNode C C))
 -&gt; Block CmmNode C C -&gt; LabelMap (LabelMap (Block CmmNode C C)))
-&gt; LabelMap (LabelMap (Block CmmNode C C))
-&gt; CmmGraph
-&gt; LabelMap (LabelMap (Block CmmNode C C))
forall a. (a -&gt; Block CmmNode C C -&gt; a) -&gt; a -&gt; CmmGraph -&gt; a
</span><a href="GHC.Cmm.Utils.html#foldlGraphBlocks"><span class="hs-identifier hs-var">foldlGraphBlocks</span></a></span><span> </span><span class="annot"><span class="annottext">LabelMap (LabelMap (Block CmmNode C C))
-&gt; Block CmmNode C C -&gt; LabelMap (LabelMap (Block CmmNode C C))
</span><a href="#local-6989586621681046784"><span class="hs-identifier hs-var">add_block</span></a></span><span> </span><span class="annot"><span class="annottext">LabelMap (LabelMap (Block CmmNode C C))
forall (map :: * -&gt; *) a. IsMap map =&gt; map a
</span><a href="GHC.Cmm.Dataflow.Collections.html#mapEmpty"><span class="hs-identifier hs-var">mapEmpty</span></a></span><span> </span><span class="annot"><span class="annottext">CmmGraph
</span><a href="#local-6989586621681046786"><span class="hs-identifier hs-var">g</span></a></span><span>
</span><span id="line-270"></span><span>
</span><span id="line-271"></span><span>     </span><span class="hs-comment">-- Build a map from proc point BlockId to pairs of:</span><span>
</span><span id="line-272"></span><span>     </span><span class="hs-comment">--  * Labels for their new procedures</span><span>
</span><span id="line-273"></span><span>     </span><span class="hs-comment">--  * Labels for the info tables of their new procedures (only if</span><span>
</span><span id="line-274"></span><span>     </span><span class="hs-comment">--    the proc point is a callPP)</span><span>
</span><span id="line-275"></span><span>     </span><span class="hs-comment">-- Due to common blockification, we may overestimate the set of procpoints.</span><span>
</span><span id="line-276"></span><span>     </span><span class="hs-keyword">let</span><span> </span><span id="local-6989586621681046755"><span class="annot"><span class="annottext">add_label :: LabelMap (CLabel, Maybe CLabel)
-&gt; BlockId -&gt; LabelMap (CLabel, Maybe CLabel)
</span><a href="#local-6989586621681046755"><span class="hs-identifier hs-var hs-var">add_label</span></a></span></span><span> </span><span id="local-6989586621681046754"><span class="annot"><span class="annottext">LabelMap (CLabel, Maybe CLabel)
</span><a href="#local-6989586621681046754"><span class="hs-identifier hs-var">map</span></a></span></span><span> </span><span id="local-6989586621681046753"><span class="annot"><span class="annottext">BlockId
</span><a href="#local-6989586621681046753"><span class="hs-identifier hs-var">pp</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">KeyOf LabelMap
-&gt; (CLabel, Maybe CLabel)
-&gt; LabelMap (CLabel, Maybe CLabel)
-&gt; LabelMap (CLabel, Maybe CLabel)
forall (map :: * -&gt; *) a.
IsMap map =&gt;
KeyOf map -&gt; a -&gt; map a -&gt; map a
</span><a href="GHC.Cmm.Dataflow.Collections.html#mapInsert"><span class="hs-identifier hs-var">mapInsert</span></a></span><span> </span><span class="annot"><span class="annottext">KeyOf LabelMap
BlockId
</span><a href="#local-6989586621681046753"><span class="hs-identifier hs-var">pp</span></a></span><span> </span><span class="annot"><span class="annottext">(CLabel, Maybe CLabel)
</span><a href="#local-6989586621681046752"><span class="hs-identifier hs-var">lbls</span></a></span><span> </span><span class="annot"><span class="annottext">LabelMap (CLabel, Maybe CLabel)
</span><a href="#local-6989586621681046754"><span class="hs-identifier hs-var">map</span></a></span><span>
</span><span id="line-277"></span><span>           </span><span class="hs-keyword">where</span><span> </span><span id="local-6989586621681046752"><span class="annot"><span class="annottext">lbls :: (CLabel, Maybe CLabel)
</span><a href="#local-6989586621681046752"><span class="hs-identifier hs-var hs-var">lbls</span></a></span></span><span> </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">BlockId
</span><a href="#local-6989586621681046753"><span class="hs-identifier hs-var">pp</span></a></span><span> </span><span class="annot"><span class="annottext">BlockId -&gt; BlockId -&gt; Bool
forall a. Eq a =&gt; a -&gt; a -&gt; Bool
</span><span class="hs-operator hs-var">==</span></span><span> </span><span class="annot"><span class="annottext">BlockId
</span><a href="#local-6989586621681046785"><span class="hs-identifier hs-var">entry</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">CLabel
</span><a href="#local-6989586621681046795"><span class="hs-identifier hs-var">entry_label</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">(CmmInfoTable -&gt; CLabel) -&gt; Maybe CmmInfoTable -&gt; Maybe CLabel
forall (f :: * -&gt; *) a b. Functor f =&gt; (a -&gt; b) -&gt; f a -&gt; f b
</span><a href="../../base/src/GHC.Base.html#fmap"><span class="hs-identifier hs-var">fmap</span></a></span><span> </span><span class="annot"><span class="annottext">CmmInfoTable -&gt; CLabel
</span><a href="GHC.Cmm.html#cit_lbl"><span class="hs-identifier hs-var hs-var">cit_lbl</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">KeyOf LabelMap -&gt; LabelMap CmmInfoTable -&gt; Maybe CmmInfoTable
forall (map :: * -&gt; *) a.
IsMap map =&gt;
KeyOf map -&gt; map a -&gt; Maybe a
</span><a href="GHC.Cmm.Dataflow.Collections.html#mapLookup"><span class="hs-identifier hs-var">mapLookup</span></a></span><span> </span><span class="annot"><span class="annottext">KeyOf LabelMap
BlockId
</span><a href="#local-6989586621681046785"><span class="hs-identifier hs-var">entry</span></a></span><span> </span><span class="annot"><span class="annottext">LabelMap CmmInfoTable
</span><a href="#local-6989586621681046788"><span class="hs-identifier hs-var">info_tbls</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-278"></span><span>                      </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="../../base/src/GHC.Base.html#otherwise"><span class="hs-identifier hs-var">otherwise</span></a></span><span>   </span><span class="hs-glyph">=</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">CLabel
</span><a href="#local-6989586621681046750"><span class="hs-identifier hs-var">block_lbl</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">Bool -&gt; Maybe ()
forall (f :: * -&gt; *). Alternative f =&gt; Bool -&gt; f ()
</span><a href="../../base/src/Control.Monad.html#guard"><span class="hs-identifier hs-var">guard</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">ElemOf ProcPointSet -&gt; ProcPointSet -&gt; Bool
forall set. IsSet set =&gt; ElemOf set -&gt; set -&gt; Bool
</span><a href="GHC.Cmm.Dataflow.Collections.html#setMember"><span class="hs-identifier hs-var">setMember</span></a></span><span> </span><span class="annot"><span class="annottext">ElemOf ProcPointSet
BlockId
</span><a href="#local-6989586621681046753"><span class="hs-identifier hs-var">pp</span></a></span><span> </span><span class="annot"><span class="annottext">ProcPointSet
</span><a href="#local-6989586621681046794"><span class="hs-identifier hs-var">callPPs</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">Maybe () -&gt; Maybe CLabel -&gt; Maybe CLabel
forall (m :: * -&gt; *) a b. Monad m =&gt; m a -&gt; m b -&gt; m b
</span><a href="../../base/src/GHC.Base.html#%3E%3E"><span class="hs-operator hs-var">&gt;&gt;</span></a></span><span>
</span><span id="line-279"></span><span>                                                    </span><span class="annot"><span class="annottext">CLabel -&gt; Maybe CLabel
forall a. a -&gt; Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-var">Just</span></a></span><span> </span><span class="annot"><span class="annottext">CLabel
</span><a href="#local-6989586621681046749"><span class="hs-identifier hs-var">info_table_lbl</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-280"></span><span>                      </span><span class="hs-keyword">where</span><span> </span><span id="local-6989586621681046750"><span class="annot"><span class="annottext">block_lbl :: CLabel
</span><a href="#local-6989586621681046750"><span class="hs-identifier hs-var hs-var">block_lbl</span></a></span></span><span>      </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">BlockId -&gt; CLabel
</span><a href="GHC.Cmm.BlockId.html#blockLbl"><span class="hs-identifier hs-var">blockLbl</span></a></span><span> </span><span class="annot"><span class="annottext">BlockId
</span><a href="#local-6989586621681046753"><span class="hs-identifier hs-var">pp</span></a></span><span>
</span><span id="line-281"></span><span>                            </span><span id="local-6989586621681046749"><span class="annot"><span class="annottext">info_table_lbl :: CLabel
</span><a href="#local-6989586621681046749"><span class="hs-identifier hs-var hs-var">info_table_lbl</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">BlockId -&gt; CLabel
</span><a href="GHC.Cmm.BlockId.html#infoTblLbl"><span class="hs-identifier hs-var">infoTblLbl</span></a></span><span> </span><span class="annot"><span class="annottext">BlockId
</span><a href="#local-6989586621681046753"><span class="hs-identifier hs-var">pp</span></a></span><span>
</span><span id="line-282"></span><span>
</span><span id="line-283"></span><span>         </span><span class="annot"><a href="#local-6989586621681046746"><span class="hs-identifier hs-type">procLabels</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Cmm.Dataflow.Label.html#LabelMap"><span class="hs-identifier hs-type">LabelMap</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Cmm.CLabel.html#CLabel"><span class="hs-identifier hs-type">CLabel</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Maybe"><span class="hs-identifier hs-type">Maybe</span></a></span><span> </span><span class="annot"><a href="GHC.Cmm.CLabel.html#CLabel"><span class="hs-identifier hs-type">CLabel</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-284"></span><span>         </span><span id="local-6989586621681046746"><span class="annot"><span class="annottext">procLabels :: LabelMap (CLabel, Maybe CLabel)
</span><a href="#local-6989586621681046746"><span class="hs-identifier hs-var hs-var">procLabels</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(LabelMap (CLabel, Maybe CLabel)
 -&gt; BlockId -&gt; LabelMap (CLabel, Maybe CLabel))
-&gt; LabelMap (CLabel, Maybe CLabel)
-&gt; [BlockId]
-&gt; LabelMap (CLabel, Maybe CLabel)
forall (t :: * -&gt; *) b a.
Foldable t =&gt;
(b -&gt; a -&gt; b) -&gt; b -&gt; t a -&gt; b
</span><a href="../../base/src/Data.Foldable.html#foldl%27"><span class="hs-identifier hs-var">foldl'</span></a></span><span> </span><span class="annot"><span class="annottext">LabelMap (CLabel, Maybe CLabel)
-&gt; BlockId -&gt; LabelMap (CLabel, Maybe CLabel)
</span><a href="#local-6989586621681046755"><span class="hs-identifier hs-var">add_label</span></a></span><span> </span><span class="annot"><span class="annottext">LabelMap (CLabel, Maybe CLabel)
forall (map :: * -&gt; *) a. IsMap map =&gt; map a
</span><a href="GHC.Cmm.Dataflow.Collections.html#mapEmpty"><span class="hs-identifier hs-var">mapEmpty</span></a></span><span>
</span><span id="line-285"></span><span>                             </span><span class="hs-special">(</span><span class="annot"><span class="annottext">(BlockId -&gt; Bool) -&gt; [BlockId] -&gt; [BlockId]
forall a. (a -&gt; Bool) -&gt; [a] -&gt; [a]
</span><a href="../../base/src/GHC.List.html#filter"><span class="hs-identifier hs-var">filter</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">(BlockId -&gt; LabelMap (Block CmmNode C C) -&gt; Bool)
-&gt; LabelMap (Block CmmNode C C) -&gt; BlockId -&gt; Bool
forall a b c. (a -&gt; b -&gt; c) -&gt; b -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#flip"><span class="hs-identifier hs-var">flip</span></a></span><span> </span><span class="annot"><span class="annottext">BlockId -&gt; LabelMap (Block CmmNode C C) -&gt; Bool
forall (map :: * -&gt; *) a. IsMap map =&gt; KeyOf map -&gt; map a -&gt; Bool
</span><a href="GHC.Cmm.Dataflow.Collections.html#mapMember"><span class="hs-identifier hs-var">mapMember</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">CmmGraph -&gt; LabelMap (Block CmmNode C C)
</span><a href="GHC.Cmm.Utils.html#toBlockMap"><span class="hs-identifier hs-var">toBlockMap</span></a></span><span> </span><span class="annot"><span class="annottext">CmmGraph
</span><a href="#local-6989586621681046786"><span class="hs-identifier hs-var">g</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">ProcPointSet -&gt; [ElemOf ProcPointSet]
forall set. IsSet set =&gt; set -&gt; [ElemOf set]
</span><a href="GHC.Cmm.Dataflow.Collections.html#setElems"><span class="hs-identifier hs-var">setElems</span></a></span><span> </span><span class="annot"><span class="annottext">ProcPointSet
</span><a href="#local-6989586621681046793"><span class="hs-identifier hs-var">procPoints</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-286"></span><span>
</span><span id="line-287"></span><span>     </span><span class="hs-comment">-- In each new graph, add blocks jumping off to the new procedures,</span><span>
</span><span id="line-288"></span><span>     </span><span class="hs-comment">-- and replace branches to procpoints with branches to the jump-off blocks</span><span>
</span><span id="line-289"></span><span>     </span><span class="hs-keyword">let</span><span> </span><span class="annot"><a href="#local-6989586621681046741"><span class="hs-identifier hs-type">add_jump_block</span></a></span><span>
</span><span id="line-290"></span><span>             </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Cmm.Dataflow.Label.html#LabelMap"><span class="hs-identifier hs-type">LabelMap</span></a></span><span> </span><span class="annot"><a href="GHC.Cmm.Dataflow.Label.html#Label"><span class="hs-identifier hs-type">Label</span></a></span><span class="hs-special">,</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Cmm.html#CmmBlock"><span class="hs-identifier hs-type">CmmBlock</span></a></span><span class="hs-special">]</span><span class="hs-special">)</span><span>
</span><span id="line-291"></span><span>             </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Cmm.Dataflow.Label.html#Label"><span class="hs-identifier hs-type">Label</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Cmm.CLabel.html#CLabel"><span class="hs-identifier hs-type">CLabel</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-292"></span><span>             </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Types.Unique.Supply.html#UniqSM"><span class="hs-identifier hs-type">UniqSM</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Cmm.Dataflow.Label.html#LabelMap"><span class="hs-identifier hs-type">LabelMap</span></a></span><span> </span><span class="annot"><a href="GHC.Cmm.Dataflow.Label.html#Label"><span class="hs-identifier hs-type">Label</span></a></span><span class="hs-special">,</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Cmm.html#CmmBlock"><span class="hs-identifier hs-type">CmmBlock</span></a></span><span class="hs-special">]</span><span class="hs-special">)</span><span>
</span><span id="line-293"></span><span>         </span><span id="local-6989586621681046741"><span class="annot"><span class="annottext">add_jump_block :: (LabelMap BlockId, [Block CmmNode C C])
-&gt; (BlockId, CLabel)
-&gt; UniqSM (LabelMap BlockId, [Block CmmNode C C])
</span><a href="#local-6989586621681046741"><span class="hs-identifier hs-var hs-var">add_jump_block</span></a></span></span><span> </span><span class="hs-special">(</span><span id="local-6989586621681046739"><span class="annot"><span class="annottext">LabelMap BlockId
</span><a href="#local-6989586621681046739"><span class="hs-identifier hs-var">env</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681046738"><span class="annot"><span class="annottext">[Block CmmNode C C]
</span><a href="#local-6989586621681046738"><span class="hs-identifier hs-var">bs</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-special">(</span><span id="local-6989586621681046737"><span class="annot"><span class="annottext">BlockId
</span><a href="#local-6989586621681046737"><span class="hs-identifier hs-var">pp</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681046736"><span class="annot"><span class="annottext">CLabel
</span><a href="#local-6989586621681046736"><span class="hs-identifier hs-var">l</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span>
</span><span id="line-294"></span><span>           </span><span class="hs-keyword">do</span><span> </span><span id="local-6989586621681046735"><span class="annot"><span class="annottext">BlockId
</span><a href="#local-6989586621681046735"><span class="hs-identifier hs-var">bid</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">(Unique -&gt; BlockId) -&gt; UniqSM Unique -&gt; UniqSM BlockId
forall (m :: * -&gt; *) a1 r. Monad m =&gt; (a1 -&gt; r) -&gt; m a1 -&gt; m r
</span><a href="../../base/src/GHC.Base.html#liftM"><span class="hs-identifier hs-var">liftM</span></a></span><span> </span><span class="annot"><span class="annottext">Unique -&gt; BlockId
</span><a href="GHC.Cmm.BlockId.html#mkBlockId"><span class="hs-identifier hs-var">mkBlockId</span></a></span><span> </span><span class="annot"><span class="annottext">UniqSM Unique
forall (m :: * -&gt; *). MonadUnique m =&gt; m Unique
</span><a href="GHC.Types.Unique.Supply.html#getUniqueM"><span class="hs-identifier hs-var">getUniqueM</span></a></span><span>
</span><span id="line-295"></span><span>              </span><span class="hs-keyword">let</span><span> </span><span id="local-6989586621681046731"><span class="annot"><span class="annottext">b :: Block CmmNode C C
</span><a href="#local-6989586621681046731"><span class="hs-identifier hs-var hs-var">b</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">CmmNode C O
-&gt; Block CmmNode O O -&gt; CmmNode O C -&gt; Block CmmNode C C
forall (n :: Extensibility -&gt; Extensibility -&gt; *).
n C O -&gt; Block n O O -&gt; n O C -&gt; Block n C C
</span><a href="GHC.Cmm.Dataflow.Block.html#blockJoin"><span class="hs-identifier hs-var">blockJoin</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">BlockId -&gt; CmmTickScope -&gt; CmmNode C O
</span><a href="GHC.Cmm.Node.html#CmmEntry"><span class="hs-identifier hs-var">CmmEntry</span></a></span><span> </span><span class="annot"><span class="annottext">BlockId
</span><a href="#local-6989586621681046735"><span class="hs-identifier hs-var">bid</span></a></span><span> </span><span class="annot"><span class="annottext">CmmTickScope
</span><a href="GHC.Cmm.Node.html#GlobalScope"><span class="hs-identifier hs-var">GlobalScope</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">Block CmmNode O O
forall (n :: Extensibility -&gt; Extensibility -&gt; *). Block n O O
</span><a href="GHC.Cmm.Dataflow.Block.html#emptyBlock"><span class="hs-identifier hs-var">emptyBlock</span></a></span><span> </span><span class="annot"><span class="annottext">CmmNode O C
</span><a href="#local-6989586621681046726"><span class="hs-identifier hs-var">jump</span></a></span><span>
</span><span id="line-296"></span><span>                  </span><span id="local-6989586621681046725"><span class="annot"><span class="annottext">live :: [GlobalReg]
</span><a href="#local-6989586621681046725"><span class="hs-identifier hs-var hs-var">live</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">BlockId -&gt; [GlobalReg]
</span><a href="#local-6989586621681046761"><span class="hs-identifier hs-var">ppLiveness</span></a></span><span> </span><span class="annot"><span class="annottext">BlockId
</span><a href="#local-6989586621681046737"><span class="hs-identifier hs-var">pp</span></a></span><span>
</span><span id="line-297"></span><span>                  </span><span id="local-6989586621681046726"><span class="annot"><span class="annottext">jump :: CmmNode O C
</span><a href="#local-6989586621681046726"><span class="hs-identifier hs-var hs-var">jump</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">CmmExpr
-&gt; Maybe BlockId -&gt; [GlobalReg] -&gt; Int -&gt; Int -&gt; Int -&gt; CmmNode O C
</span><a href="GHC.Cmm.Node.html#CmmCall"><span class="hs-identifier hs-var">CmmCall</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">CmmLit -&gt; CmmExpr
</span><a href="GHC.Cmm.Expr.html#CmmLit"><span class="hs-identifier hs-var">CmmLit</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">CLabel -&gt; CmmLit
</span><a href="GHC.Cmm.Expr.html#CmmLabel"><span class="hs-identifier hs-var">CmmLabel</span></a></span><span> </span><span class="annot"><span class="annottext">CLabel
</span><a href="#local-6989586621681046736"><span class="hs-identifier hs-var">l</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">Maybe BlockId
forall a. Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Nothing"><span class="hs-identifier hs-var">Nothing</span></a></span><span> </span><span class="annot"><span class="annottext">[GlobalReg]
</span><a href="#local-6989586621681046725"><span class="hs-identifier hs-var">live</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">0</span></span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">0</span></span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">0</span></span><span>
</span><span id="line-298"></span><span>              </span><span class="annot"><span class="annottext">(LabelMap BlockId, [Block CmmNode C C])
-&gt; UniqSM (LabelMap BlockId, [Block CmmNode C C])
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">KeyOf LabelMap -&gt; BlockId -&gt; LabelMap BlockId -&gt; LabelMap BlockId
forall (map :: * -&gt; *) a.
IsMap map =&gt;
KeyOf map -&gt; a -&gt; map a -&gt; map a
</span><a href="GHC.Cmm.Dataflow.Collections.html#mapInsert"><span class="hs-identifier hs-var">mapInsert</span></a></span><span> </span><span class="annot"><span class="annottext">KeyOf LabelMap
BlockId
</span><a href="#local-6989586621681046737"><span class="hs-identifier hs-var">pp</span></a></span><span> </span><span class="annot"><span class="annottext">BlockId
</span><a href="#local-6989586621681046735"><span class="hs-identifier hs-var">bid</span></a></span><span> </span><span class="annot"><span class="annottext">LabelMap BlockId
</span><a href="#local-6989586621681046739"><span class="hs-identifier hs-var">env</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">Block CmmNode C C
</span><a href="#local-6989586621681046731"><span class="hs-identifier hs-var">b</span></a></span><span> </span><span class="annot"><span class="annottext">Block CmmNode C C -&gt; [Block CmmNode C C] -&gt; [Block CmmNode C C]
forall a. a -&gt; [a] -&gt; [a]
</span><span class="hs-glyph hs-var">:</span></span><span> </span><span class="annot"><span class="annottext">[Block CmmNode C C]
</span><a href="#local-6989586621681046738"><span class="hs-identifier hs-var">bs</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-299"></span><span>
</span><span id="line-300"></span><span>         </span><span class="annot"><a href="#local-6989586621681046722"><span class="hs-identifier hs-type">add_jumps</span></a></span><span>
</span><span id="line-301"></span><span>             </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Cmm.Dataflow.Label.html#LabelMap"><span class="hs-identifier hs-type">LabelMap</span></a></span><span> </span><span class="annot"><a href="GHC.Cmm.html#CmmGraph"><span class="hs-identifier hs-type">CmmGraph</span></a></span><span>
</span><span id="line-302"></span><span>             </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Cmm.Dataflow.Label.html#Label"><span class="hs-identifier hs-type">Label</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Cmm.Dataflow.Label.html#LabelMap"><span class="hs-identifier hs-type">LabelMap</span></a></span><span> </span><span class="annot"><a href="GHC.Cmm.html#CmmBlock"><span class="hs-identifier hs-type">CmmBlock</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-303"></span><span>             </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Types.Unique.Supply.html#UniqSM"><span class="hs-identifier hs-type">UniqSM</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Cmm.Dataflow.Label.html#LabelMap"><span class="hs-identifier hs-type">LabelMap</span></a></span><span> </span><span class="annot"><a href="GHC.Cmm.html#CmmGraph"><span class="hs-identifier hs-type">CmmGraph</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-304"></span><span>         </span><span id="local-6989586621681046722"><span class="annot"><span class="annottext">add_jumps :: LabelMap CmmGraph
-&gt; (BlockId, LabelMap (Block CmmNode C C))
-&gt; UniqSM (LabelMap CmmGraph)
</span><a href="#local-6989586621681046722"><span class="hs-identifier hs-var hs-var">add_jumps</span></a></span></span><span> </span><span id="local-6989586621681046721"><span class="annot"><span class="annottext">LabelMap CmmGraph
</span><a href="#local-6989586621681046721"><span class="hs-identifier hs-var">newGraphEnv</span></a></span></span><span> </span><span class="hs-special">(</span><span id="local-6989586621681046720"><span class="annot"><span class="annottext">BlockId
</span><a href="#local-6989586621681046720"><span class="hs-identifier hs-var">ppId</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681046719"><span class="annot"><span class="annottext">LabelMap (Block CmmNode C C)
</span><a href="#local-6989586621681046719"><span class="hs-identifier hs-var">blockEnv</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span>
</span><span id="line-305"></span><span>           </span><span class="hs-keyword">do</span><span> </span><span class="hs-keyword">let</span><span> </span><span id="local-6989586621681046718"><span class="annot"><span class="annottext">needed_jumps :: [(BlockId, CLabel)]
</span><a href="#local-6989586621681046718"><span class="hs-identifier hs-var hs-var">needed_jumps</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-comment">-- find which procpoints we currently branch to</span><span>
</span><span id="line-306"></span><span>                    </span><span class="annot"><span class="annottext">(Block CmmNode C C -&gt; [(BlockId, CLabel)] -&gt; [(BlockId, CLabel)])
-&gt; [(BlockId, CLabel)]
-&gt; LabelMap (Block CmmNode C C)
-&gt; [(BlockId, CLabel)]
forall (map :: * -&gt; *) a b.
IsMap map =&gt;
(a -&gt; b -&gt; b) -&gt; b -&gt; map a -&gt; b
</span><a href="GHC.Cmm.Dataflow.Collections.html#mapFoldr"><span class="hs-identifier hs-var">mapFoldr</span></a></span><span> </span><span class="annot"><span class="annottext">Block CmmNode C C -&gt; [(BlockId, CLabel)] -&gt; [(BlockId, CLabel)]
</span><a href="#local-6989586621681046716"><span class="hs-identifier hs-var">add_if_branch_to_pp</span></a></span><span> </span><span class="hs-special">[</span><span class="hs-special">]</span><span> </span><span class="annot"><span class="annottext">LabelMap (Block CmmNode C C)
</span><a href="#local-6989586621681046719"><span class="hs-identifier hs-var">blockEnv</span></a></span><span>
</span><span id="line-307"></span><span>                  </span><span class="annot"><a href="#local-6989586621681046716"><span class="hs-identifier hs-type">add_if_branch_to_pp</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Cmm.html#CmmBlock"><span class="hs-identifier hs-type">CmmBlock</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="hs-special">(</span><span class="annot"><a href="GHC.Cmm.BlockId.html#BlockId"><span class="hs-identifier hs-type">BlockId</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Cmm.CLabel.html#CLabel"><span class="hs-identifier hs-type">CLabel</span></a></span><span class="hs-special">)</span><span class="hs-special">]</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="hs-special">(</span><span class="annot"><a href="GHC.Cmm.BlockId.html#BlockId"><span class="hs-identifier hs-type">BlockId</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Cmm.CLabel.html#CLabel"><span class="hs-identifier hs-type">CLabel</span></a></span><span class="hs-special">)</span><span class="hs-special">]</span><span>
</span><span id="line-308"></span><span>                  </span><span id="local-6989586621681046716"><span class="annot"><span class="annottext">add_if_branch_to_pp :: Block CmmNode C C -&gt; [(BlockId, CLabel)] -&gt; [(BlockId, CLabel)]
</span><a href="#local-6989586621681046716"><span class="hs-identifier hs-var hs-var">add_if_branch_to_pp</span></a></span></span><span> </span><span id="local-6989586621681046715"><span class="annot"><span class="annottext">Block CmmNode C C
</span><a href="#local-6989586621681046715"><span class="hs-identifier hs-var">block</span></a></span></span><span> </span><span id="local-6989586621681046714"><span class="annot"><span class="annottext">[(BlockId, CLabel)]
</span><a href="#local-6989586621681046714"><span class="hs-identifier hs-var">rst</span></a></span></span><span> </span><span class="hs-glyph">=</span><span>
</span><span id="line-309"></span><span>                    </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">Block CmmNode C C -&gt; CmmNode O C
forall (n :: Extensibility -&gt; Extensibility -&gt; *)
       (x :: Extensibility).
Block n x C -&gt; n O C
</span><a href="GHC.Cmm.Dataflow.Block.html#lastNode"><span class="hs-identifier hs-var">lastNode</span></a></span><span> </span><span class="annot"><span class="annottext">Block CmmNode C C
</span><a href="#local-6989586621681046715"><span class="hs-identifier hs-var">block</span></a></span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-310"></span><span>                      </span><span class="annot"><a href="GHC.Cmm.Node.html#CmmBranch"><span class="hs-identifier hs-type">CmmBranch</span></a></span><span> </span><span id="local-6989586621681046710"><span class="annot"><span class="annottext">BlockId
</span><a href="#local-6989586621681046710"><span class="hs-identifier hs-var">id</span></a></span></span><span>          </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">BlockId -&gt; [(BlockId, CLabel)] -&gt; [(BlockId, CLabel)]
</span><a href="#local-6989586621681046709"><span class="hs-identifier hs-var">add_if_pp</span></a></span><span> </span><span class="annot"><span class="annottext">BlockId
</span><a href="#local-6989586621681046710"><span class="hs-identifier hs-var">id</span></a></span><span> </span><span class="annot"><span class="annottext">[(BlockId, CLabel)]
</span><a href="#local-6989586621681046714"><span class="hs-identifier hs-var">rst</span></a></span><span>
</span><span id="line-311"></span><span>                      </span><span class="annot"><a href="GHC.Cmm.Node.html#CmmCondBranch"><span class="hs-identifier hs-type">CmmCondBranch</span></a></span><span> </span><span class="annot"><span class="annottext">CmmExpr
</span><span class="hs-identifier">_</span></span><span> </span><span id="local-6989586621681046705"><span class="annot"><span class="annottext">BlockId
</span><a href="#local-6989586621681046705"><span class="hs-identifier hs-var">ti</span></a></span></span><span> </span><span id="local-6989586621681046704"><span class="annot"><span class="annottext">BlockId
</span><a href="#local-6989586621681046704"><span class="hs-identifier hs-var">fi</span></a></span></span><span> </span><span class="annot"><span class="annottext">Maybe Bool
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">BlockId -&gt; [(BlockId, CLabel)] -&gt; [(BlockId, CLabel)]
</span><a href="#local-6989586621681046709"><span class="hs-identifier hs-var">add_if_pp</span></a></span><span> </span><span class="annot"><span class="annottext">BlockId
</span><a href="#local-6989586621681046705"><span class="hs-identifier hs-var">ti</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">BlockId -&gt; [(BlockId, CLabel)] -&gt; [(BlockId, CLabel)]
</span><a href="#local-6989586621681046709"><span class="hs-identifier hs-var">add_if_pp</span></a></span><span> </span><span class="annot"><span class="annottext">BlockId
</span><a href="#local-6989586621681046704"><span class="hs-identifier hs-var">fi</span></a></span><span> </span><span class="annot"><span class="annottext">[(BlockId, CLabel)]
</span><a href="#local-6989586621681046714"><span class="hs-identifier hs-var">rst</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-312"></span><span>                      </span><span class="annot"><a href="GHC.Cmm.Node.html#CmmSwitch"><span class="hs-identifier hs-type">CmmSwitch</span></a></span><span> </span><span class="annot"><span class="annottext">CmmExpr
</span><span class="hs-identifier">_</span></span><span> </span><span id="local-6989586621681046699"><span class="annot"><span class="annottext">SwitchTargets
</span><a href="#local-6989586621681046699"><span class="hs-identifier hs-var">ids</span></a></span></span><span>       </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">(BlockId -&gt; [(BlockId, CLabel)] -&gt; [(BlockId, CLabel)])
-&gt; [(BlockId, CLabel)] -&gt; [BlockId] -&gt; [(BlockId, CLabel)]
forall (t :: * -&gt; *) a b.
Foldable t =&gt;
(a -&gt; b -&gt; b) -&gt; b -&gt; t a -&gt; b
</span><a href="../../base/src/Data.Foldable.html#foldr"><span class="hs-identifier hs-var">foldr</span></a></span><span> </span><span class="annot"><span class="annottext">BlockId -&gt; [(BlockId, CLabel)] -&gt; [(BlockId, CLabel)]
</span><a href="#local-6989586621681046709"><span class="hs-identifier hs-var">add_if_pp</span></a></span><span> </span><span class="annot"><span class="annottext">[(BlockId, CLabel)]
</span><a href="#local-6989586621681046714"><span class="hs-identifier hs-var">rst</span></a></span><span> </span><span class="annot"><span class="annottext">([BlockId] -&gt; [(BlockId, CLabel)])
-&gt; [BlockId] -&gt; [(BlockId, CLabel)]
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">SwitchTargets -&gt; [BlockId]
</span><a href="GHC.Cmm.Switch.html#switchTargetsToList"><span class="hs-identifier hs-var">switchTargetsToList</span></a></span><span> </span><span class="annot"><span class="annottext">SwitchTargets
</span><a href="#local-6989586621681046699"><span class="hs-identifier hs-var">ids</span></a></span><span>
</span><span id="line-313"></span><span>                      </span><span class="annot"><span class="annottext">CmmNode O C
</span><span class="hs-identifier">_</span></span><span>                     </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">[(BlockId, CLabel)]
</span><a href="#local-6989586621681046714"><span class="hs-identifier hs-var">rst</span></a></span><span>
</span><span id="line-314"></span><span>
</span><span id="line-315"></span><span>                  </span><span class="hs-comment">-- when jumping to a PP that has an info table, if</span><span>
</span><span id="line-316"></span><span>                  </span><span class="hs-comment">-- tablesNextToCode is off we must jump to the entry</span><span>
</span><span id="line-317"></span><span>                  </span><span class="hs-comment">-- label instead.</span><span>
</span><span id="line-318"></span><span>                  </span><span id="local-6989586621681046696"><span class="annot"><span class="annottext">platform :: Platform
</span><a href="#local-6989586621681046696"><span class="hs-identifier hs-var hs-var">platform</span></a></span></span><span>         </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">DynFlags -&gt; Platform
</span><a href="GHC.Driver.Session.html#targetPlatform"><span class="hs-identifier hs-var hs-var">targetPlatform</span></a></span><span> </span><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621681046796"><span class="hs-identifier hs-var">dflags</span></a></span><span>
</span><span id="line-319"></span><span>                  </span><span id="local-6989586621681046694"><span class="annot"><span class="annottext">tablesNextToCode :: Bool
</span><a href="#local-6989586621681046694"><span class="hs-identifier hs-var hs-var">tablesNextToCode</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Platform -&gt; Bool
</span><a href="../../ghc-boot/src/GHC.Platform.html#platformTablesNextToCode"><span class="hs-identifier hs-var hs-var">platformTablesNextToCode</span></a></span><span> </span><span class="annot"><span class="annottext">Platform
</span><a href="#local-6989586621681046696"><span class="hs-identifier hs-var">platform</span></a></span><span>
</span><span id="line-320"></span><span>                  </span><span id="local-6989586621681046692"><span class="annot"><span class="annottext">jump_label :: Maybe CLabel -&gt; CLabel -&gt; CLabel
</span><a href="#local-6989586621681046692"><span class="hs-identifier hs-var hs-var">jump_label</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-type">Just</span></a></span><span> </span><span id="local-6989586621681046691"><span class="annot"><span class="annottext">CLabel
</span><a href="#local-6989586621681046691"><span class="hs-identifier hs-var">info_lbl</span></a></span></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">CLabel
</span><span class="hs-identifier">_</span></span><span>
</span><span id="line-321"></span><span>                             </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="#local-6989586621681046694"><span class="hs-identifier hs-var">tablesNextToCode</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">CLabel
</span><a href="#local-6989586621681046691"><span class="hs-identifier hs-var">info_lbl</span></a></span><span>
</span><span id="line-322"></span><span>                             </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="../../base/src/GHC.Base.html#otherwise"><span class="hs-identifier hs-var">otherwise</span></a></span><span>        </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">CLabel -&gt; CLabel
</span><a href="GHC.Cmm.CLabel.html#toEntryLbl"><span class="hs-identifier hs-var">toEntryLbl</span></a></span><span> </span><span class="annot"><span class="annottext">CLabel
</span><a href="#local-6989586621681046691"><span class="hs-identifier hs-var">info_lbl</span></a></span><span>
</span><span id="line-323"></span><span>                  </span><span class="annot"><a href="#local-6989586621681046692"><span class="hs-identifier hs-var">jump_label</span></a></span><span> </span><span class="annot"><span class="annottext">Maybe CLabel
</span><a href="../../base/src/GHC.Maybe.html#Nothing"><span class="hs-identifier hs-var">Nothing</span></a></span><span>  </span><span id="local-6989586621681046689"><span class="annot"><span class="annottext">CLabel
</span><a href="#local-6989586621681046689"><span class="hs-identifier hs-var">block_lbl</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">CLabel
</span><a href="#local-6989586621681046689"><span class="hs-identifier hs-var">block_lbl</span></a></span><span>
</span><span id="line-324"></span><span>
</span><span id="line-325"></span><span>                  </span><span id="local-6989586621681046709"><span class="annot"><span class="annottext">add_if_pp :: BlockId -&gt; [(BlockId, CLabel)] -&gt; [(BlockId, CLabel)]
</span><a href="#local-6989586621681046709"><span class="hs-identifier hs-var hs-var">add_if_pp</span></a></span></span><span> </span><span id="local-6989586621681046688"><span class="annot"><span class="annottext">BlockId
</span><a href="#local-6989586621681046688"><span class="hs-identifier hs-var">id</span></a></span></span><span> </span><span id="local-6989586621681046687"><span class="annot"><span class="annottext">[(BlockId, CLabel)]
</span><a href="#local-6989586621681046687"><span class="hs-identifier hs-var">rst</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">KeyOf LabelMap
-&gt; LabelMap (CLabel, Maybe CLabel) -&gt; Maybe (CLabel, Maybe CLabel)
forall (map :: * -&gt; *) a.
IsMap map =&gt;
KeyOf map -&gt; map a -&gt; Maybe a
</span><a href="GHC.Cmm.Dataflow.Collections.html#mapLookup"><span class="hs-identifier hs-var">mapLookup</span></a></span><span> </span><span class="annot"><span class="annottext">KeyOf LabelMap
BlockId
</span><a href="#local-6989586621681046688"><span class="hs-identifier hs-var">id</span></a></span><span> </span><span class="annot"><span class="annottext">LabelMap (CLabel, Maybe CLabel)
</span><a href="#local-6989586621681046746"><span class="hs-identifier hs-var">procLabels</span></a></span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-326"></span><span>                                       </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-type">Just</span></a></span><span> </span><span class="hs-special">(</span><span id="local-6989586621681046686"><span class="annot"><span class="annottext">CLabel
</span><a href="#local-6989586621681046686"><span class="hs-identifier hs-var">lbl</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681046685"><span class="annot"><span class="annottext">Maybe CLabel
</span><a href="#local-6989586621681046685"><span class="hs-identifier hs-var">mb_info_lbl</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">BlockId
</span><a href="#local-6989586621681046688"><span class="hs-identifier hs-var">id</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">Maybe CLabel -&gt; CLabel -&gt; CLabel
</span><a href="#local-6989586621681046692"><span class="hs-identifier hs-var">jump_label</span></a></span><span> </span><span class="annot"><span class="annottext">Maybe CLabel
</span><a href="#local-6989586621681046685"><span class="hs-identifier hs-var">mb_info_lbl</span></a></span><span> </span><span class="annot"><span class="annottext">CLabel
</span><a href="#local-6989586621681046686"><span class="hs-identifier hs-var">lbl</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">(BlockId, CLabel) -&gt; [(BlockId, CLabel)] -&gt; [(BlockId, CLabel)]
forall a. a -&gt; [a] -&gt; [a]
</span><span class="hs-glyph hs-var">:</span></span><span> </span><span class="annot"><span class="annottext">[(BlockId, CLabel)]
</span><a href="#local-6989586621681046687"><span class="hs-identifier hs-var">rst</span></a></span><span>
</span><span id="line-327"></span><span>                                       </span><span class="annot"><span class="annottext">Maybe (CLabel, Maybe CLabel)
</span><a href="../../base/src/GHC.Maybe.html#Nothing"><span class="hs-identifier hs-var">Nothing</span></a></span><span>                 </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">[(BlockId, CLabel)]
</span><a href="#local-6989586621681046687"><span class="hs-identifier hs-var">rst</span></a></span><span>
</span><span id="line-328"></span><span>              </span><span class="hs-special">(</span><span id="local-6989586621681046684"><span class="annot"><span class="annottext">LabelMap BlockId
</span><a href="#local-6989586621681046684"><span class="hs-identifier hs-var">jumpEnv</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681046683"><span class="annot"><span class="annottext">[Block CmmNode C C]
</span><a href="#local-6989586621681046683"><span class="hs-identifier hs-var">jumpBlocks</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">&lt;-</span><span>
</span><span id="line-329"></span><span>                 </span><span class="annot"><span class="annottext">((LabelMap BlockId, [Block CmmNode C C])
 -&gt; (BlockId, CLabel)
 -&gt; UniqSM (LabelMap BlockId, [Block CmmNode C C]))
-&gt; (LabelMap BlockId, [Block CmmNode C C])
-&gt; [(BlockId, CLabel)]
-&gt; UniqSM (LabelMap BlockId, [Block CmmNode C C])
forall (t :: * -&gt; *) (m :: * -&gt; *) b a.
(Foldable t, Monad m) =&gt;
(b -&gt; a -&gt; m b) -&gt; b -&gt; t a -&gt; m b
</span><a href="../../base/src/Control.Monad.html#foldM"><span class="hs-identifier hs-var">foldM</span></a></span><span> </span><span class="annot"><span class="annottext">(LabelMap BlockId, [Block CmmNode C C])
-&gt; (BlockId, CLabel)
-&gt; UniqSM (LabelMap BlockId, [Block CmmNode C C])
</span><a href="#local-6989586621681046741"><span class="hs-identifier hs-var">add_jump_block</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">LabelMap BlockId
forall (map :: * -&gt; *) a. IsMap map =&gt; map a
</span><a href="GHC.Cmm.Dataflow.Collections.html#mapEmpty"><span class="hs-identifier hs-var">mapEmpty</span></a></span><span class="hs-special">,</span><span> </span><span class="hs-special">[</span><span class="hs-special">]</span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">[(BlockId, CLabel)]
</span><a href="#local-6989586621681046718"><span class="hs-identifier hs-var">needed_jumps</span></a></span><span>
</span><span id="line-330"></span><span>                  </span><span class="hs-comment">-- update the entry block</span><span>
</span><span id="line-331"></span><span>              </span><span class="hs-keyword">let</span><span> </span><span id="local-6989586621681046681"><span class="annot"><span class="annottext">b :: Block CmmNode C C
</span><a href="#local-6989586621681046681"><span class="hs-identifier hs-var hs-var">b</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">String -&gt; Maybe (Block CmmNode C C) -&gt; Block CmmNode C C
forall a. HasCallStack =&gt; String -&gt; Maybe a -&gt; a
</span><a href="GHC.Data.Maybe.html#expectJust"><span class="hs-identifier hs-var">expectJust</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;block in env&quot;</span></span><span> </span><span class="annot"><span class="annottext">(Maybe (Block CmmNode C C) -&gt; Block CmmNode C C)
-&gt; Maybe (Block CmmNode C C) -&gt; Block CmmNode C C
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">KeyOf LabelMap
-&gt; LabelMap (Block CmmNode C C) -&gt; Maybe (Block CmmNode C C)
forall (map :: * -&gt; *) a.
IsMap map =&gt;
KeyOf map -&gt; map a -&gt; Maybe a
</span><a href="GHC.Cmm.Dataflow.Collections.html#mapLookup"><span class="hs-identifier hs-var">mapLookup</span></a></span><span> </span><span class="annot"><span class="annottext">KeyOf LabelMap
BlockId
</span><a href="#local-6989586621681046720"><span class="hs-identifier hs-var">ppId</span></a></span><span> </span><span class="annot"><span class="annottext">LabelMap (Block CmmNode C C)
</span><a href="#local-6989586621681046719"><span class="hs-identifier hs-var">blockEnv</span></a></span><span>
</span><span id="line-332"></span><span>                  </span><span id="local-6989586621681046680"><span class="annot"><span class="annottext">blockEnv' :: LabelMap (Block CmmNode C C)
</span><a href="#local-6989586621681046680"><span class="hs-identifier hs-var hs-var">blockEnv'</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">KeyOf LabelMap
-&gt; Block CmmNode C C
-&gt; LabelMap (Block CmmNode C C)
-&gt; LabelMap (Block CmmNode C C)
forall (map :: * -&gt; *) a.
IsMap map =&gt;
KeyOf map -&gt; a -&gt; map a -&gt; map a
</span><a href="GHC.Cmm.Dataflow.Collections.html#mapInsert"><span class="hs-identifier hs-var">mapInsert</span></a></span><span> </span><span class="annot"><span class="annottext">KeyOf LabelMap
BlockId
</span><a href="#local-6989586621681046720"><span class="hs-identifier hs-var">ppId</span></a></span><span> </span><span class="annot"><span class="annottext">Block CmmNode C C
</span><a href="#local-6989586621681046681"><span class="hs-identifier hs-var">b</span></a></span><span> </span><span class="annot"><span class="annottext">LabelMap (Block CmmNode C C)
</span><a href="#local-6989586621681046719"><span class="hs-identifier hs-var">blockEnv</span></a></span><span>
</span><span id="line-333"></span><span>                  </span><span class="hs-comment">-- replace branches to procpoints with branches to jumps</span><span>
</span><span id="line-334"></span><span>                  </span><span id="local-6989586621681046679"><span class="annot"><span class="annottext">blockEnv'' :: LabelMap (Block CmmNode C C)
</span><a href="#local-6989586621681046679"><span class="hs-identifier hs-var hs-var">blockEnv''</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">CmmGraph -&gt; LabelMap (Block CmmNode C C)
</span><a href="GHC.Cmm.Utils.html#toBlockMap"><span class="hs-identifier hs-var">toBlockMap</span></a></span><span> </span><span class="annot"><span class="annottext">(CmmGraph -&gt; LabelMap (Block CmmNode C C))
-&gt; CmmGraph -&gt; LabelMap (Block CmmNode C C)
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">LabelMap BlockId -&gt; CmmGraph -&gt; CmmGraph
</span><a href="GHC.Cmm.ProcPoint.html#replaceBranches"><span class="hs-identifier hs-var">replaceBranches</span></a></span><span> </span><span class="annot"><span class="annottext">LabelMap BlockId
</span><a href="#local-6989586621681046684"><span class="hs-identifier hs-var">jumpEnv</span></a></span><span> </span><span class="annot"><span class="annottext">(CmmGraph -&gt; CmmGraph) -&gt; CmmGraph -&gt; CmmGraph
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">BlockId -&gt; LabelMap (Block CmmNode C C) -&gt; CmmGraph
</span><a href="GHC.Cmm.Utils.html#ofBlockMap"><span class="hs-identifier hs-var">ofBlockMap</span></a></span><span> </span><span class="annot"><span class="annottext">BlockId
</span><a href="#local-6989586621681046720"><span class="hs-identifier hs-var">ppId</span></a></span><span> </span><span class="annot"><span class="annottext">LabelMap (Block CmmNode C C)
</span><a href="#local-6989586621681046680"><span class="hs-identifier hs-var">blockEnv'</span></a></span><span>
</span><span id="line-335"></span><span>                  </span><span class="hs-comment">-- add the jump blocks to the graph</span><span>
</span><span id="line-336"></span><span>                  </span><span id="local-6989586621681046676"><span class="annot"><span class="annottext">blockEnv''' :: LabelMap (Block CmmNode C C)
</span><a href="#local-6989586621681046676"><span class="hs-identifier hs-var hs-var">blockEnv'''</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(LabelMap (Block CmmNode C C)
 -&gt; Block CmmNode C C -&gt; LabelMap (Block CmmNode C C))
-&gt; LabelMap (Block CmmNode C C)
-&gt; [Block CmmNode C C]
-&gt; LabelMap (Block CmmNode C C)
forall (t :: * -&gt; *) b a.
Foldable t =&gt;
(b -&gt; a -&gt; b) -&gt; b -&gt; t a -&gt; b
</span><a href="../../base/src/Data.Foldable.html#foldl%27"><span class="hs-identifier hs-var">foldl'</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">(Block CmmNode C C
 -&gt; LabelMap (Block CmmNode C C) -&gt; LabelMap (Block CmmNode C C))
-&gt; LabelMap (Block CmmNode C C)
-&gt; Block CmmNode C C
-&gt; LabelMap (Block CmmNode C C)
forall a b c. (a -&gt; b -&gt; c) -&gt; b -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#flip"><span class="hs-identifier hs-var">flip</span></a></span><span> </span><span class="annot"><span class="annottext">Block CmmNode C C
-&gt; LabelMap (Block CmmNode C C) -&gt; LabelMap (Block CmmNode C C)
forall (block :: Extensibility -&gt; Extensibility -&gt; *).
(NonLocal block, HasDebugCallStack) =&gt;
block C C -&gt; LabelMap (block C C) -&gt; LabelMap (block C C)
</span><a href="GHC.Cmm.Dataflow.Graph.html#addBlock"><span class="hs-identifier hs-var">addBlock</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">LabelMap (Block CmmNode C C)
</span><a href="#local-6989586621681046679"><span class="hs-identifier hs-var">blockEnv''</span></a></span><span> </span><span class="annot"><span class="annottext">[Block CmmNode C C]
</span><a href="#local-6989586621681046683"><span class="hs-identifier hs-var">jumpBlocks</span></a></span><span>
</span><span id="line-337"></span><span>              </span><span class="hs-keyword">let</span><span> </span><span id="local-6989586621681046674"><span class="annot"><span class="annottext">g' :: CmmGraph
</span><a href="#local-6989586621681046674"><span class="hs-identifier hs-var hs-var">g'</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">BlockId -&gt; LabelMap (Block CmmNode C C) -&gt; CmmGraph
</span><a href="GHC.Cmm.Utils.html#ofBlockMap"><span class="hs-identifier hs-var">ofBlockMap</span></a></span><span> </span><span class="annot"><span class="annottext">BlockId
</span><a href="#local-6989586621681046720"><span class="hs-identifier hs-var">ppId</span></a></span><span> </span><span class="annot"><span class="annottext">LabelMap (Block CmmNode C C)
</span><a href="#local-6989586621681046676"><span class="hs-identifier hs-var">blockEnv'''</span></a></span><span>
</span><span id="line-338"></span><span>              </span><span class="hs-comment">-- pprTrace &quot;g' pre jumps&quot; (ppr g') $ do</span><span>
</span><span id="line-339"></span><span>              </span><span class="annot"><span class="annottext">LabelMap CmmGraph -&gt; UniqSM (LabelMap CmmGraph)
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">KeyOf LabelMap
-&gt; CmmGraph -&gt; LabelMap CmmGraph -&gt; LabelMap CmmGraph
forall (map :: * -&gt; *) a.
IsMap map =&gt;
KeyOf map -&gt; a -&gt; map a -&gt; map a
</span><a href="GHC.Cmm.Dataflow.Collections.html#mapInsert"><span class="hs-identifier hs-var">mapInsert</span></a></span><span> </span><span class="annot"><span class="annottext">KeyOf LabelMap
BlockId
</span><a href="#local-6989586621681046720"><span class="hs-identifier hs-var">ppId</span></a></span><span> </span><span class="annot"><span class="annottext">CmmGraph
</span><a href="#local-6989586621681046674"><span class="hs-identifier hs-var">g'</span></a></span><span> </span><span class="annot"><span class="annottext">LabelMap CmmGraph
</span><a href="#local-6989586621681046721"><span class="hs-identifier hs-var">newGraphEnv</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-340"></span><span>
</span><span id="line-341"></span><span>     </span><span id="local-6989586621681046673"><span class="annot"><span class="annottext">LabelMap CmmGraph
</span><a href="#local-6989586621681046673"><span class="hs-identifier hs-var">graphEnv</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">(LabelMap CmmGraph
 -&gt; (BlockId, LabelMap (Block CmmNode C C))
 -&gt; UniqSM (LabelMap CmmGraph))
-&gt; LabelMap CmmGraph
-&gt; [(BlockId, LabelMap (Block CmmNode C C))]
-&gt; UniqSM (LabelMap CmmGraph)
forall (t :: * -&gt; *) (m :: * -&gt; *) b a.
(Foldable t, Monad m) =&gt;
(b -&gt; a -&gt; m b) -&gt; b -&gt; t a -&gt; m b
</span><a href="../../base/src/Control.Monad.html#foldM"><span class="hs-identifier hs-var">foldM</span></a></span><span> </span><span class="annot"><span class="annottext">LabelMap CmmGraph
-&gt; (BlockId, LabelMap (Block CmmNode C C))
-&gt; UniqSM (LabelMap CmmGraph)
</span><a href="#local-6989586621681046722"><span class="hs-identifier hs-var">add_jumps</span></a></span><span> </span><span class="annot"><span class="annottext">LabelMap CmmGraph
forall (map :: * -&gt; *) a. IsMap map =&gt; map a
</span><a href="GHC.Cmm.Dataflow.Collections.html#mapEmpty"><span class="hs-identifier hs-var">mapEmpty</span></a></span><span> </span><span class="annot"><span class="annottext">([(BlockId, LabelMap (Block CmmNode C C))]
 -&gt; UniqSM (LabelMap CmmGraph))
-&gt; [(BlockId, LabelMap (Block CmmNode C C))]
-&gt; UniqSM (LabelMap CmmGraph)
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">LabelMap (LabelMap (Block CmmNode C C))
-&gt; [(KeyOf LabelMap, LabelMap (Block CmmNode C C))]
forall (map :: * -&gt; *) a. IsMap map =&gt; map a -&gt; [(KeyOf map, a)]
</span><a href="GHC.Cmm.Dataflow.Collections.html#mapToList"><span class="hs-identifier hs-var">mapToList</span></a></span><span> </span><span class="annot"><span class="annottext">LabelMap (LabelMap (Block CmmNode C C))
</span><a href="#local-6989586621681046756"><span class="hs-identifier hs-var">graphEnv</span></a></span><span>
</span><span id="line-342"></span><span>
</span><span id="line-343"></span><span>     </span><span class="hs-keyword">let</span><span> </span><span id="local-6989586621681046671"><span class="annot"><span class="annottext">to_proc :: (BlockId, CmmGraph) -&gt; CmmDecl
</span><a href="#local-6989586621681046671"><span class="hs-identifier hs-var hs-var">to_proc</span></a></span></span><span> </span><span class="hs-special">(</span><span id="local-6989586621681046670"><span class="annot"><span class="annottext">BlockId
</span><a href="#local-6989586621681046670"><span class="hs-identifier hs-var">bid</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681046669"><span class="annot"><span class="annottext">CmmGraph
</span><a href="#local-6989586621681046669"><span class="hs-identifier hs-var">g</span></a></span></span><span class="hs-special">)</span><span>
</span><span id="line-344"></span><span>             </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">BlockId
</span><a href="#local-6989586621681046670"><span class="hs-identifier hs-var">bid</span></a></span><span> </span><span class="annot"><span class="annottext">BlockId -&gt; BlockId -&gt; Bool
forall a. Eq a =&gt; a -&gt; a -&gt; Bool
</span><span class="hs-operator hs-var">==</span></span><span> </span><span class="annot"><span class="annottext">BlockId
</span><a href="#local-6989586621681046785"><span class="hs-identifier hs-var">entry</span></a></span><span>
</span><span id="line-345"></span><span>             </span><span class="hs-glyph">=</span><span>  </span><span class="annot"><span class="annottext">CmmTopInfo -&gt; CLabel -&gt; [GlobalReg] -&gt; CmmGraph -&gt; CmmDecl
forall d h g. h -&gt; CLabel -&gt; [GlobalReg] -&gt; g -&gt; GenCmmDecl d h g
</span><a href="GHC.Cmm.html#CmmProc"><span class="hs-identifier hs-var">CmmProc</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">TopInfo :: LabelMap CmmInfoTable -&gt; CmmStackInfo -&gt; CmmTopInfo
</span><a href="GHC.Cmm.html#TopInfo"><span class="hs-identifier hs-type">TopInfo</span></a></span><span> </span><span class="hs-special">{</span><span class="annot"><span class="annottext">info_tbls :: LabelMap CmmInfoTable
</span><a href="GHC.Cmm.html#info_tbls"><span class="hs-identifier hs-var">info_tbls</span></a></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">LabelMap CmmInfoTable
</span><a href="#local-6989586621681046788"><span class="hs-identifier hs-var">info_tbls</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-346"></span><span>                                  </span><span class="annot"><span class="annottext">stack_info :: CmmStackInfo
</span><a href="GHC.Cmm.html#stack_info"><span class="hs-identifier hs-var">stack_info</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">CmmStackInfo
</span><a href="#local-6989586621681046667"><span class="hs-identifier hs-var">stack_info</span></a></span><span class="hs-special">}</span><span class="hs-special">)</span><span>
</span><span id="line-347"></span><span>                        </span><span class="annot"><span class="annottext">CLabel
</span><a href="#local-6989586621681046787"><span class="hs-identifier hs-var">top_l</span></a></span><span> </span><span class="annot"><span class="annottext">[GlobalReg]
</span><a href="#local-6989586621681046666"><span class="hs-identifier hs-var">live</span></a></span><span> </span><span class="annot"><span class="annottext">CmmGraph
</span><a href="#local-6989586621681046665"><span class="hs-identifier hs-var">g'</span></a></span><span>
</span><span id="line-348"></span><span>             </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="../../base/src/GHC.Base.html#otherwise"><span class="hs-identifier hs-var">otherwise</span></a></span><span>
</span><span id="line-349"></span><span>             </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">String -&gt; Maybe (CLabel, Maybe CLabel) -&gt; (CLabel, Maybe CLabel)
forall a. HasCallStack =&gt; String -&gt; Maybe a -&gt; a
</span><a href="GHC.Data.Maybe.html#expectJust"><span class="hs-identifier hs-var">expectJust</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;pp label&quot;</span></span><span> </span><span class="annot"><span class="annottext">(Maybe (CLabel, Maybe CLabel) -&gt; (CLabel, Maybe CLabel))
-&gt; Maybe (CLabel, Maybe CLabel) -&gt; (CLabel, Maybe CLabel)
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">KeyOf LabelMap
-&gt; LabelMap (CLabel, Maybe CLabel) -&gt; Maybe (CLabel, Maybe CLabel)
forall (map :: * -&gt; *) a.
IsMap map =&gt;
KeyOf map -&gt; map a -&gt; Maybe a
</span><a href="GHC.Cmm.Dataflow.Collections.html#mapLookup"><span class="hs-identifier hs-var">mapLookup</span></a></span><span> </span><span class="annot"><span class="annottext">KeyOf LabelMap
BlockId
</span><a href="#local-6989586621681046670"><span class="hs-identifier hs-var">bid</span></a></span><span> </span><span class="annot"><span class="annottext">LabelMap (CLabel, Maybe CLabel)
</span><a href="#local-6989586621681046746"><span class="hs-identifier hs-var">procLabels</span></a></span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-350"></span><span>                 </span><span class="hs-special">(</span><span id="local-6989586621681046664"><span class="annot"><span class="annottext">CLabel
</span><a href="#local-6989586621681046664"><span class="hs-identifier hs-var">lbl</span></a></span></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-type">Just</span></a></span><span> </span><span id="local-6989586621681046663"><span class="annot"><span class="annottext">CLabel
</span><a href="#local-6989586621681046663"><span class="hs-identifier hs-var">info_lbl</span></a></span></span><span class="hs-special">)</span><span>
</span><span id="line-351"></span><span>                    </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">CmmTopInfo -&gt; CLabel -&gt; [GlobalReg] -&gt; CmmGraph -&gt; CmmDecl
forall d h g. h -&gt; CLabel -&gt; [GlobalReg] -&gt; g -&gt; GenCmmDecl d h g
</span><a href="GHC.Cmm.html#CmmProc"><span class="hs-identifier hs-var">CmmProc</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">TopInfo :: LabelMap CmmInfoTable -&gt; CmmStackInfo -&gt; CmmTopInfo
</span><a href="GHC.Cmm.html#TopInfo"><span class="hs-identifier hs-type">TopInfo</span></a></span><span> </span><span class="hs-special">{</span><span> </span><span class="annot"><span class="annottext">info_tbls :: LabelMap CmmInfoTable
</span><a href="GHC.Cmm.html#info_tbls"><span class="hs-identifier hs-var">info_tbls</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">KeyOf LabelMap -&gt; CmmInfoTable -&gt; LabelMap CmmInfoTable
forall (map :: * -&gt; *) a. IsMap map =&gt; KeyOf map -&gt; a -&gt; map a
</span><a href="GHC.Cmm.Dataflow.Collections.html#mapSingleton"><span class="hs-identifier hs-var">mapSingleton</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">CmmGraph -&gt; BlockId
forall (n :: Extensibility -&gt; Extensibility -&gt; *).
GenCmmGraph n -&gt; BlockId
</span><a href="GHC.Cmm.html#g_entry"><span class="hs-identifier hs-var hs-var">g_entry</span></a></span><span> </span><span class="annot"><span class="annottext">CmmGraph
</span><a href="#local-6989586621681046669"><span class="hs-identifier hs-var">g</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">CLabel -&gt; CmmInfoTable
</span><a href="GHC.Cmm.Info.html#mkEmptyContInfoTable"><span class="hs-identifier hs-var">mkEmptyContInfoTable</span></a></span><span> </span><span class="annot"><span class="annottext">CLabel
</span><a href="#local-6989586621681046663"><span class="hs-identifier hs-var">info_lbl</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-352"></span><span>                                        </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">stack_info :: CmmStackInfo
</span><a href="GHC.Cmm.html#stack_info"><span class="hs-identifier hs-var">stack_info</span></a></span><span class="hs-glyph">=</span><span class="annot"><span class="annottext">CmmStackInfo
</span><a href="#local-6989586621681046667"><span class="hs-identifier hs-var">stack_info</span></a></span><span class="hs-special">}</span><span class="hs-special">)</span><span>
</span><span id="line-353"></span><span>                               </span><span class="annot"><span class="annottext">CLabel
</span><a href="#local-6989586621681046664"><span class="hs-identifier hs-var">lbl</span></a></span><span> </span><span class="annot"><span class="annottext">[GlobalReg]
</span><a href="#local-6989586621681046666"><span class="hs-identifier hs-var">live</span></a></span><span> </span><span class="annot"><span class="annottext">CmmGraph
</span><a href="#local-6989586621681046665"><span class="hs-identifier hs-var">g'</span></a></span><span>
</span><span id="line-354"></span><span>                 </span><span class="hs-special">(</span><span id="local-6989586621681046660"><span class="annot"><span class="annottext">CLabel
</span><a href="#local-6989586621681046660"><span class="hs-identifier hs-var">lbl</span></a></span></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">Maybe CLabel
</span><a href="../../base/src/GHC.Maybe.html#Nothing"><span class="hs-identifier hs-var">Nothing</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-355"></span><span>                    </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">CmmTopInfo -&gt; CLabel -&gt; [GlobalReg] -&gt; CmmGraph -&gt; CmmDecl
forall d h g. h -&gt; CLabel -&gt; [GlobalReg] -&gt; g -&gt; GenCmmDecl d h g
</span><a href="GHC.Cmm.html#CmmProc"><span class="hs-identifier hs-var">CmmProc</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">TopInfo :: LabelMap CmmInfoTable -&gt; CmmStackInfo -&gt; CmmTopInfo
</span><a href="GHC.Cmm.html#TopInfo"><span class="hs-identifier hs-type">TopInfo</span></a></span><span> </span><span class="hs-special">{</span><span class="annot"><span class="annottext">info_tbls :: LabelMap CmmInfoTable
</span><a href="GHC.Cmm.html#info_tbls"><span class="hs-identifier hs-var">info_tbls</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">LabelMap CmmInfoTable
forall (map :: * -&gt; *) a. IsMap map =&gt; map a
</span><a href="GHC.Cmm.Dataflow.Collections.html#mapEmpty"><span class="hs-identifier hs-var">mapEmpty</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">stack_info :: CmmStackInfo
</span><a href="GHC.Cmm.html#stack_info"><span class="hs-identifier hs-var">stack_info</span></a></span><span class="hs-glyph">=</span><span class="annot"><span class="annottext">CmmStackInfo
</span><a href="#local-6989586621681046667"><span class="hs-identifier hs-var">stack_info</span></a></span><span class="hs-special">}</span><span class="hs-special">)</span><span>
</span><span id="line-356"></span><span>                               </span><span class="annot"><span class="annottext">CLabel
</span><a href="#local-6989586621681046660"><span class="hs-identifier hs-var">lbl</span></a></span><span> </span><span class="annot"><span class="annottext">[GlobalReg]
</span><a href="#local-6989586621681046666"><span class="hs-identifier hs-var">live</span></a></span><span> </span><span class="annot"><span class="annottext">CmmGraph
</span><a href="#local-6989586621681046665"><span class="hs-identifier hs-var">g'</span></a></span><span>
</span><span id="line-357"></span><span>                </span><span class="hs-keyword">where</span><span>
</span><span id="line-358"></span><span>                 </span><span id="local-6989586621681046665"><span class="annot"><span class="annottext">g' :: CmmGraph
</span><a href="#local-6989586621681046665"><span class="hs-identifier hs-var hs-var">g'</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">CmmGraph -&gt; CmmGraph
</span><a href="#local-6989586621681046659"><span class="hs-identifier hs-var">replacePPIds</span></a></span><span> </span><span class="annot"><span class="annottext">CmmGraph
</span><a href="#local-6989586621681046669"><span class="hs-identifier hs-var">g</span></a></span><span>
</span><span id="line-359"></span><span>                 </span><span id="local-6989586621681046666"><span class="annot"><span class="annottext">live :: [GlobalReg]
</span><a href="#local-6989586621681046666"><span class="hs-identifier hs-var hs-var">live</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">BlockId -&gt; [GlobalReg]
</span><a href="#local-6989586621681046761"><span class="hs-identifier hs-var">ppLiveness</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">CmmGraph -&gt; BlockId
forall (n :: Extensibility -&gt; Extensibility -&gt; *).
GenCmmGraph n -&gt; BlockId
</span><a href="GHC.Cmm.html#g_entry"><span class="hs-identifier hs-var hs-var">g_entry</span></a></span><span> </span><span class="annot"><span class="annottext">CmmGraph
</span><a href="#local-6989586621681046665"><span class="hs-identifier hs-var">g'</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-360"></span><span>                 </span><span id="local-6989586621681046667"><span class="annot"><span class="annottext">stack_info :: CmmStackInfo
</span><a href="#local-6989586621681046667"><span class="hs-identifier hs-var hs-var">stack_info</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">StackInfo :: Int -&gt; Bool -&gt; CmmStackInfo
</span><a href="GHC.Cmm.html#StackInfo"><span class="hs-identifier hs-type">StackInfo</span></a></span><span> </span><span class="hs-special">{</span><span> </span><span class="annot"><span class="annottext">arg_space :: Int
</span><a href="GHC.Cmm.html#arg_space"><span class="hs-identifier hs-var">arg_space</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">0</span></span><span>
</span><span id="line-361"></span><span>                                        </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">do_layout :: Bool
</span><a href="#local-6989586621681046656"><span class="hs-identifier hs-var">do_layout</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Bool
</span><span class="hs-identifier hs-var">True</span></span><span> </span><span class="hs-special">}</span><span>
</span><span id="line-362"></span><span>                               </span><span class="hs-comment">-- cannot use panic, this is printed by -ddump-cmm</span><span>
</span><span id="line-363"></span><span>
</span><span id="line-364"></span><span>         </span><span class="hs-comment">-- References to procpoint IDs can now be replaced with the</span><span>
</span><span id="line-365"></span><span>         </span><span class="hs-comment">-- infotable's label</span><span>
</span><span id="line-366"></span><span>         </span><span id="local-6989586621681046659"><span class="annot"><span class="annottext">replacePPIds :: CmmGraph -&gt; CmmGraph
</span><a href="#local-6989586621681046659"><span class="hs-identifier hs-var hs-var">replacePPIds</span></a></span></span><span> </span><span id="local-6989586621681046655"><span class="annot"><span class="annottext">CmmGraph
</span><a href="#local-6989586621681046655"><span class="hs-identifier hs-var">g</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-pragma">{-# SCC</span><span> </span><span class="hs-pragma">&quot;replacePPIds&quot;</span><span> </span><span class="hs-pragma">#-}</span><span>
</span><span id="line-367"></span><span>                          </span><span class="annot"><span class="annottext">(CmmNode C O -&gt; CmmNode C O, CmmNode O O -&gt; CmmNode O O,
 CmmNode O C -&gt; CmmNode O C)
-&gt; CmmGraph -&gt; CmmGraph
</span><a href="GHC.Cmm.Utils.html#mapGraphNodes"><span class="hs-identifier hs-var">mapGraphNodes</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">CmmNode C O -&gt; CmmNode C O
forall a. a -&gt; a
</span><a href="../../base/src/GHC.Base.html#id"><span class="hs-identifier hs-var">id</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">(CmmExpr -&gt; CmmExpr) -&gt; CmmNode O O -&gt; CmmNode O O
forall (e :: Extensibility) (x :: Extensibility).
(CmmExpr -&gt; CmmExpr) -&gt; CmmNode e x -&gt; CmmNode e x
</span><a href="GHC.Cmm.Node.html#mapExp"><span class="hs-identifier hs-var">mapExp</span></a></span><span> </span><span class="annot"><span class="annottext">CmmExpr -&gt; CmmExpr
</span><a href="#local-6989586621681046651"><span class="hs-identifier hs-var">repl</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">(CmmExpr -&gt; CmmExpr) -&gt; CmmNode O C -&gt; CmmNode O C
forall (e :: Extensibility) (x :: Extensibility).
(CmmExpr -&gt; CmmExpr) -&gt; CmmNode e x -&gt; CmmNode e x
</span><a href="GHC.Cmm.Node.html#mapExp"><span class="hs-identifier hs-var">mapExp</span></a></span><span> </span><span class="annot"><span class="annottext">CmmExpr -&gt; CmmExpr
</span><a href="#local-6989586621681046651"><span class="hs-identifier hs-var">repl</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">CmmGraph
</span><a href="#local-6989586621681046655"><span class="hs-identifier hs-var">g</span></a></span><span>
</span><span id="line-368"></span><span>           </span><span class="hs-keyword">where</span><span> </span><span id="local-6989586621681046651"><span class="annot"><span class="annottext">repl :: CmmExpr -&gt; CmmExpr
</span><a href="#local-6989586621681046651"><span class="hs-identifier hs-var hs-var">repl</span></a></span></span><span> </span><span id="local-6989586621681046649"><span class="annot"><span class="annottext">e :: CmmExpr
</span><a href="#local-6989586621681046649"><span class="hs-identifier hs-var">e</span></a></span></span><span class="hs-glyph">@</span><span class="hs-special">(</span><span class="annot"><a href="GHC.Cmm.Expr.html#CmmLit"><span class="hs-identifier hs-type">CmmLit</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Cmm.Expr.html#CmmBlock"><span class="hs-identifier hs-type">CmmBlock</span></a></span><span> </span><span id="local-6989586621681046647"><span class="annot"><span class="annottext">BlockId
</span><a href="#local-6989586621681046647"><span class="hs-identifier hs-var">bid</span></a></span></span><span class="hs-special">)</span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span>
</span><span id="line-369"></span><span>                   </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">KeyOf LabelMap
-&gt; LabelMap (CLabel, Maybe CLabel) -&gt; Maybe (CLabel, Maybe CLabel)
forall (map :: * -&gt; *) a.
IsMap map =&gt;
KeyOf map -&gt; map a -&gt; Maybe a
</span><a href="GHC.Cmm.Dataflow.Collections.html#mapLookup"><span class="hs-identifier hs-var">mapLookup</span></a></span><span> </span><span class="annot"><span class="annottext">KeyOf LabelMap
BlockId
</span><a href="#local-6989586621681046647"><span class="hs-identifier hs-var">bid</span></a></span><span> </span><span class="annot"><span class="annottext">LabelMap (CLabel, Maybe CLabel)
</span><a href="#local-6989586621681046746"><span class="hs-identifier hs-var">procLabels</span></a></span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-370"></span><span>                     </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-type">Just</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">CLabel
</span><span class="hs-identifier">_</span></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-type">Just</span></a></span><span> </span><span id="local-6989586621681046646"><span class="annot"><span class="annottext">CLabel
</span><a href="#local-6989586621681046646"><span class="hs-identifier hs-var">info_lbl</span></a></span></span><span class="hs-special">)</span><span>  </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">CmmLit -&gt; CmmExpr
</span><a href="GHC.Cmm.Expr.html#CmmLit"><span class="hs-identifier hs-var">CmmLit</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">CLabel -&gt; CmmLit
</span><a href="GHC.Cmm.Expr.html#CmmLabel"><span class="hs-identifier hs-var">CmmLabel</span></a></span><span> </span><span class="annot"><span class="annottext">CLabel
</span><a href="#local-6989586621681046646"><span class="hs-identifier hs-var">info_lbl</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-371"></span><span>                     </span><span class="annot"><span class="annottext">Maybe (CLabel, Maybe CLabel)
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">CmmExpr
</span><a href="#local-6989586621681046649"><span class="hs-identifier hs-var">e</span></a></span><span>
</span><span id="line-372"></span><span>                 </span><span class="annot"><a href="#local-6989586621681046651"><span class="hs-identifier hs-var">repl</span></a></span><span> </span><span id="local-6989586621681046645"><span class="annot"><span class="annottext">CmmExpr
</span><a href="#local-6989586621681046645"><span class="hs-identifier hs-var">e</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">CmmExpr
</span><a href="#local-6989586621681046645"><span class="hs-identifier hs-var">e</span></a></span><span>
</span><span id="line-373"></span><span>
</span><span id="line-374"></span><span>     </span><span class="hs-comment">-- The C back end expects to see return continuations before the</span><span>
</span><span id="line-375"></span><span>     </span><span class="hs-comment">-- call sites.  Here, we sort them in reverse order -- it gets</span><span>
</span><span id="line-376"></span><span>     </span><span class="hs-comment">-- reversed later.</span><span>
</span><span id="line-377"></span><span>     </span><span class="hs-keyword">let</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Int
</span><span class="hs-identifier">_</span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681046644"><span class="annot"><span class="annottext">LabelMap Int
</span><a href="#local-6989586621681046644"><span class="hs-identifier hs-var">block_order</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span>
</span><span id="line-378"></span><span>             </span><span class="annot"><span class="annottext">((Int, LabelMap Int) -&gt; Block CmmNode C C -&gt; (Int, LabelMap Int))
-&gt; (Int, LabelMap Int)
-&gt; [Block CmmNode C C]
-&gt; (Int, LabelMap Int)
forall (t :: * -&gt; *) b a.
Foldable t =&gt;
(b -&gt; a -&gt; b) -&gt; b -&gt; t a -&gt; b
</span><a href="../../base/src/Data.Foldable.html#foldl%27"><span class="hs-identifier hs-var">foldl'</span></a></span><span> </span><span class="annot"><span class="annottext">(Int, LabelMap Int) -&gt; Block CmmNode C C -&gt; (Int, LabelMap Int)
forall {a} {map :: * -&gt; *}
       {thing :: Extensibility -&gt; Extensibility -&gt; *}
       {x :: Extensibility}.
(Num a, IsMap map, NonLocal thing, KeyOf map ~ BlockId) =&gt;
(a, map a) -&gt; thing C x -&gt; (a, map a)
</span><a href="#local-6989586621681046643"><span class="hs-identifier hs-var">add_block_num</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">0</span></span><span class="hs-glyph">::</span><span class="annot"><span class="hs-identifier hs-type">Int</span></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">LabelMap Int
forall (map :: * -&gt; *) a. IsMap map =&gt; map a
</span><a href="GHC.Cmm.Dataflow.Collections.html#mapEmpty"><span class="hs-identifier hs-var">mapEmpty</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Cmm.Dataflow.Label.html#LabelMap"><span class="hs-identifier hs-type">LabelMap</span></a></span><span> </span><span class="annot"><span class="hs-identifier hs-type">Int</span></span><span class="hs-special">)</span><span>
</span><span id="line-379"></span><span>                   </span><span class="hs-special">(</span><span class="annot"><span class="annottext">CmmGraph -&gt; [Block CmmNode C C]
</span><a href="GHC.Cmm.Utils.html#revPostorder"><span class="hs-identifier hs-var">revPostorder</span></a></span><span> </span><span class="annot"><span class="annottext">CmmGraph
</span><a href="#local-6989586621681046786"><span class="hs-identifier hs-var">g</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-380"></span><span>         </span><span id="local-6989586621681046643"><span class="annot"><span class="annottext">add_block_num :: (a, map a) -&gt; thing C x -&gt; (a, map a)
</span><a href="#local-6989586621681046643"><span class="hs-identifier hs-var hs-var">add_block_num</span></a></span></span><span> </span><span class="hs-special">(</span><span id="local-6989586621681046631"><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621681046631"><span class="hs-identifier hs-var">i</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681046630"><span class="annot"><span class="annottext">map a
</span><a href="#local-6989586621681046630"><span class="hs-identifier hs-var">map</span></a></span></span><span class="hs-special">)</span><span> </span><span id="local-6989586621681046629"><span class="annot"><span class="annottext">thing C x
</span><a href="#local-6989586621681046629"><span class="hs-identifier hs-var">block</span></a></span></span><span> </span><span class="hs-glyph">=</span><span>
</span><span id="line-381"></span><span>           </span><span class="hs-special">(</span><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621681046631"><span class="hs-identifier hs-var">i</span></a></span><span> </span><span class="annot"><span class="annottext">a -&gt; a -&gt; a
forall a. Num a =&gt; a -&gt; a -&gt; a
</span><a href="../../base/src/GHC.Num.html#%2B"><span class="hs-operator hs-var">+</span></a></span><span> </span><span class="annot"><span class="annottext">a
</span><span class="hs-number">1</span></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">KeyOf map -&gt; a -&gt; map a -&gt; map a
forall (map :: * -&gt; *) a.
IsMap map =&gt;
KeyOf map -&gt; a -&gt; map a -&gt; map a
</span><a href="GHC.Cmm.Dataflow.Collections.html#mapInsert"><span class="hs-identifier hs-var">mapInsert</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">thing C x -&gt; BlockId
forall (thing :: Extensibility -&gt; Extensibility -&gt; *)
       (x :: Extensibility).
NonLocal thing =&gt;
thing C x -&gt; BlockId
</span><a href="GHC.Cmm.Dataflow.Graph.html#entryLabel"><span class="hs-identifier hs-var">entryLabel</span></a></span><span> </span><span class="annot"><span class="annottext">thing C x
</span><a href="#local-6989586621681046629"><span class="hs-identifier hs-var">block</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621681046631"><span class="hs-identifier hs-var">i</span></a></span><span> </span><span class="annot"><span class="annottext">map a
</span><a href="#local-6989586621681046630"><span class="hs-identifier hs-var">map</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-382"></span><span>         </span><span id="local-6989586621681046627"><span class="annot"><span class="annottext">sort_fn :: (BlockId, CmmGraph) -&gt; (BlockId, CmmGraph) -&gt; Ordering
</span><a href="#local-6989586621681046627"><span class="hs-identifier hs-var hs-var">sort_fn</span></a></span></span><span> </span><span class="hs-special">(</span><span id="local-6989586621681046626"><span class="annot"><span class="annottext">BlockId
</span><a href="#local-6989586621681046626"><span class="hs-identifier hs-var">bid</span></a></span></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">CmmGraph
</span><span class="hs-identifier">_</span></span><span class="hs-special">)</span><span> </span><span class="hs-special">(</span><span id="local-6989586621681046625"><span class="annot"><span class="annottext">BlockId
</span><a href="#local-6989586621681046625"><span class="hs-identifier hs-var">bid'</span></a></span></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">CmmGraph
</span><span class="hs-identifier">_</span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span>
</span><span id="line-383"></span><span>           </span><span class="annot"><span class="annottext">Int -&gt; Int -&gt; Ordering
forall a. Ord a =&gt; a -&gt; a -&gt; Ordering
</span><span class="hs-identifier hs-var">compare</span></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">String -&gt; Maybe Int -&gt; Int
forall a. HasCallStack =&gt; String -&gt; Maybe a -&gt; a
</span><a href="GHC.Data.Maybe.html#expectJust"><span class="hs-identifier hs-var">expectJust</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;block_order&quot;</span></span><span> </span><span class="annot"><span class="annottext">(Maybe Int -&gt; Int) -&gt; Maybe Int -&gt; Int
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">KeyOf LabelMap -&gt; LabelMap Int -&gt; Maybe Int
forall (map :: * -&gt; *) a.
IsMap map =&gt;
KeyOf map -&gt; map a -&gt; Maybe a
</span><a href="GHC.Cmm.Dataflow.Collections.html#mapLookup"><span class="hs-identifier hs-var">mapLookup</span></a></span><span> </span><span class="annot"><span class="annottext">KeyOf LabelMap
BlockId
</span><a href="#local-6989586621681046626"><span class="hs-identifier hs-var">bid</span></a></span><span>  </span><span class="annot"><span class="annottext">LabelMap Int
</span><a href="#local-6989586621681046644"><span class="hs-identifier hs-var">block_order</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-384"></span><span>                   </span><span class="hs-special">(</span><span class="annot"><span class="annottext">String -&gt; Maybe Int -&gt; Int
forall a. HasCallStack =&gt; String -&gt; Maybe a -&gt; a
</span><a href="GHC.Data.Maybe.html#expectJust"><span class="hs-identifier hs-var">expectJust</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;block_order&quot;</span></span><span> </span><span class="annot"><span class="annottext">(Maybe Int -&gt; Int) -&gt; Maybe Int -&gt; Int
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">KeyOf LabelMap -&gt; LabelMap Int -&gt; Maybe Int
forall (map :: * -&gt; *) a.
IsMap map =&gt;
KeyOf map -&gt; map a -&gt; Maybe a
</span><a href="GHC.Cmm.Dataflow.Collections.html#mapLookup"><span class="hs-identifier hs-var">mapLookup</span></a></span><span> </span><span class="annot"><span class="annottext">KeyOf LabelMap
BlockId
</span><a href="#local-6989586621681046625"><span class="hs-identifier hs-var">bid'</span></a></span><span> </span><span class="annot"><span class="annottext">LabelMap Int
</span><a href="#local-6989586621681046644"><span class="hs-identifier hs-var">block_order</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-385"></span><span>     </span><span id="local-6989586621681046623"><span class="annot"><span class="annottext">[CmmDecl]
</span><a href="#local-6989586621681046623"><span class="hs-identifier hs-var">procs</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">[CmmDecl] -&gt; UniqSM [CmmDecl]
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="annot"><span class="annottext">([CmmDecl] -&gt; UniqSM [CmmDecl]) -&gt; [CmmDecl] -&gt; UniqSM [CmmDecl]
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">((BlockId, CmmGraph) -&gt; CmmDecl)
-&gt; [(BlockId, CmmGraph)] -&gt; [CmmDecl]
forall a b. (a -&gt; b) -&gt; [a] -&gt; [b]
</span><a href="../../base/src/GHC.Base.html#map"><span class="hs-identifier hs-var">map</span></a></span><span> </span><span class="annot"><span class="annottext">(BlockId, CmmGraph) -&gt; CmmDecl
</span><a href="#local-6989586621681046671"><span class="hs-identifier hs-var">to_proc</span></a></span><span> </span><span class="annot"><span class="annottext">([(BlockId, CmmGraph)] -&gt; [CmmDecl])
-&gt; [(BlockId, CmmGraph)] -&gt; [CmmDecl]
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">((BlockId, CmmGraph) -&gt; (BlockId, CmmGraph) -&gt; Ordering)
-&gt; [(BlockId, CmmGraph)] -&gt; [(BlockId, CmmGraph)]
forall a. (a -&gt; a -&gt; Ordering) -&gt; [a] -&gt; [a]
</span><a href="../../base/src/Data.OldList.html#sortBy"><span class="hs-identifier hs-var">sortBy</span></a></span><span> </span><span class="annot"><span class="annottext">(BlockId, CmmGraph) -&gt; (BlockId, CmmGraph) -&gt; Ordering
</span><a href="#local-6989586621681046627"><span class="hs-identifier hs-var">sort_fn</span></a></span><span> </span><span class="annot"><span class="annottext">([(BlockId, CmmGraph)] -&gt; [(BlockId, CmmGraph)])
-&gt; [(BlockId, CmmGraph)] -&gt; [(BlockId, CmmGraph)]
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">LabelMap CmmGraph -&gt; [(KeyOf LabelMap, CmmGraph)]
forall (map :: * -&gt; *) a. IsMap map =&gt; map a -&gt; [(KeyOf map, a)]
</span><a href="GHC.Cmm.Dataflow.Collections.html#mapToList"><span class="hs-identifier hs-var">mapToList</span></a></span><span> </span><span class="annot"><span class="annottext">LabelMap CmmGraph
</span><a href="#local-6989586621681046673"><span class="hs-identifier hs-var">graphEnv</span></a></span><span>
</span><span id="line-386"></span><span>     </span><span class="annot"><span class="annottext">[CmmDecl] -&gt; UniqSM [CmmDecl]
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-comment">-- pprTrace &quot;procLabels&quot; (ppr procLabels)</span><span>
</span><span id="line-387"></span><span>            </span><span class="hs-comment">-- pprTrace &quot;splitting graphs&quot; (ppr procs)</span><span>
</span><span id="line-388"></span><span>            </span><span class="annot"><span class="annottext">[CmmDecl]
</span><a href="#local-6989586621681046623"><span class="hs-identifier hs-var">procs</span></a></span><span>
</span><span id="line-389"></span><span class="annot"><a href="GHC.Cmm.ProcPoint.html#splitAtProcPoints"><span class="hs-identifier hs-var">splitAtProcPoints</span></a></span><span> </span><span class="annot"><span class="annottext">DynFlags
</span><span class="hs-identifier">_</span></span><span> </span><span class="annot"><span class="annottext">CLabel
</span><span class="hs-identifier">_</span></span><span> </span><span class="annot"><span class="annottext">ProcPointSet
</span><span class="hs-identifier">_</span></span><span> </span><span class="annot"><span class="annottext">ProcPointSet
</span><span class="hs-identifier">_</span></span><span> </span><span class="annot"><span class="annottext">LabelMap Status
</span><span class="hs-identifier">_</span></span><span> </span><span id="local-6989586621681046622"><span class="annot"><span class="annottext">t :: CmmDecl
</span><a href="#local-6989586621681046622"><span class="hs-identifier hs-var">t</span></a></span></span><span class="hs-glyph">@</span><span class="hs-special">(</span><span class="annot"><a href="GHC.Cmm.html#CmmData"><span class="hs-identifier hs-type">CmmData</span></a></span><span> </span><span class="annot"><span class="annottext">Section
</span><span class="hs-identifier">_</span></span><span> </span><span class="annot"><span class="annottext">CmmStatics
</span><span class="hs-identifier">_</span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[CmmDecl] -&gt; UniqSM [CmmDecl]
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">[</span><span class="annot"><span class="annottext">CmmDecl
</span><a href="#local-6989586621681046622"><span class="hs-identifier hs-var">t</span></a></span><span class="hs-special">]</span><span>
</span><span id="line-390"></span><span>
</span><span id="line-391"></span><span class="hs-comment">-- Only called from GHC.Cmm.ProcPoint.splitAtProcPoints. NB. does a</span><span>
</span><span id="line-392"></span><span class="hs-comment">-- recursive lookup, see comment below.</span><span>
</span><span id="line-393"></span><span class="annot"><a href="GHC.Cmm.ProcPoint.html#replaceBranches"><span class="hs-identifier hs-type">replaceBranches</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Cmm.Dataflow.Label.html#LabelMap"><span class="hs-identifier hs-type">LabelMap</span></a></span><span> </span><span class="annot"><a href="GHC.Cmm.BlockId.html#BlockId"><span class="hs-identifier hs-type">BlockId</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Cmm.html#CmmGraph"><span class="hs-identifier hs-type">CmmGraph</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Cmm.html#CmmGraph"><span class="hs-identifier hs-type">CmmGraph</span></a></span><span>
</span><span id="line-394"></span><span id="replaceBranches"><span class="annot"><span class="annottext">replaceBranches :: LabelMap BlockId -&gt; CmmGraph -&gt; CmmGraph
</span><a href="GHC.Cmm.ProcPoint.html#replaceBranches"><span class="hs-identifier hs-var hs-var">replaceBranches</span></a></span></span><span> </span><span id="local-6989586621681046620"><span class="annot"><span class="annottext">LabelMap BlockId
</span><a href="#local-6989586621681046620"><span class="hs-identifier hs-var">env</span></a></span></span><span> </span><span id="local-6989586621681046619"><span class="annot"><span class="annottext">CmmGraph
</span><a href="#local-6989586621681046619"><span class="hs-identifier hs-var">cmmg</span></a></span></span><span>
</span><span id="line-395"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="hs-pragma">{-# SCC</span><span> </span><span class="hs-pragma">&quot;replaceBranches&quot;</span><span> </span><span class="hs-pragma">#-}</span><span>
</span><span id="line-396"></span><span>    </span><span class="annot"><span class="annottext">BlockId -&gt; LabelMap (Block CmmNode C C) -&gt; CmmGraph
</span><a href="GHC.Cmm.Utils.html#ofBlockMap"><span class="hs-identifier hs-var">ofBlockMap</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">CmmGraph -&gt; BlockId
forall (n :: Extensibility -&gt; Extensibility -&gt; *).
GenCmmGraph n -&gt; BlockId
</span><a href="GHC.Cmm.html#g_entry"><span class="hs-identifier hs-var hs-var">g_entry</span></a></span><span> </span><span class="annot"><span class="annottext">CmmGraph
</span><a href="#local-6989586621681046619"><span class="hs-identifier hs-var">cmmg</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">(LabelMap (Block CmmNode C C) -&gt; CmmGraph)
-&gt; LabelMap (Block CmmNode C C) -&gt; CmmGraph
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">(Block CmmNode C C -&gt; Block CmmNode C C)
-&gt; LabelMap (Block CmmNode C C) -&gt; LabelMap (Block CmmNode C C)
forall (map :: * -&gt; *) a b. IsMap map =&gt; (a -&gt; b) -&gt; map a -&gt; map b
</span><a href="GHC.Cmm.Dataflow.Collections.html#mapMap"><span class="hs-identifier hs-var">mapMap</span></a></span><span> </span><span class="annot"><span class="annottext">Block CmmNode C C -&gt; Block CmmNode C C
forall {x :: Extensibility}. Block CmmNode x C -&gt; Block CmmNode x C
</span><a href="#local-6989586621681046617"><span class="hs-identifier hs-var">f</span></a></span><span> </span><span class="annot"><span class="annottext">(LabelMap (Block CmmNode C C) -&gt; LabelMap (Block CmmNode C C))
-&gt; LabelMap (Block CmmNode C C) -&gt; LabelMap (Block CmmNode C C)
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">CmmGraph -&gt; LabelMap (Block CmmNode C C)
</span><a href="GHC.Cmm.Utils.html#toBlockMap"><span class="hs-identifier hs-var">toBlockMap</span></a></span><span> </span><span class="annot"><span class="annottext">CmmGraph
</span><a href="#local-6989586621681046619"><span class="hs-identifier hs-var">cmmg</span></a></span><span>
</span><span id="line-397"></span><span>  </span><span class="hs-keyword">where</span><span>
</span><span id="line-398"></span><span>    </span><span id="local-6989586621681046617"><span class="annot"><span class="annottext">f :: Block CmmNode x C -&gt; Block CmmNode x C
</span><a href="#local-6989586621681046617"><span class="hs-identifier hs-var hs-var">f</span></a></span></span><span> </span><span id="local-6989586621681046616"><span class="annot"><span class="annottext">Block CmmNode x C
</span><a href="#local-6989586621681046616"><span class="hs-identifier hs-var">block</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Block CmmNode x C -&gt; CmmNode O C -&gt; Block CmmNode x C
forall (n :: Extensibility -&gt; Extensibility -&gt; *)
       (x :: Extensibility).
Block n x C -&gt; n O C -&gt; Block n x C
</span><a href="GHC.Cmm.Dataflow.Block.html#replaceLastNode"><span class="hs-identifier hs-var">replaceLastNode</span></a></span><span> </span><span class="annot"><span class="annottext">Block CmmNode x C
</span><a href="#local-6989586621681046616"><span class="hs-identifier hs-var">block</span></a></span><span> </span><span class="annot"><span class="annottext">(CmmNode O C -&gt; Block CmmNode x C)
-&gt; CmmNode O C -&gt; Block CmmNode x C
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">CmmNode O C -&gt; CmmNode O C
</span><a href="#local-6989586621681046614"><span class="hs-identifier hs-var">last</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Block CmmNode x C -&gt; CmmNode O C
forall (n :: Extensibility -&gt; Extensibility -&gt; *)
       (x :: Extensibility).
Block n x C -&gt; n O C
</span><a href="GHC.Cmm.Dataflow.Block.html#lastNode"><span class="hs-identifier hs-var">lastNode</span></a></span><span> </span><span class="annot"><span class="annottext">Block CmmNode x C
</span><a href="#local-6989586621681046616"><span class="hs-identifier hs-var">block</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-399"></span><span>
</span><span id="line-400"></span><span>    </span><span class="annot"><a href="#local-6989586621681046614"><span class="hs-identifier hs-type">last</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Cmm.Node.html#CmmNode"><span class="hs-identifier hs-type">CmmNode</span></a></span><span> </span><span class="annot"><a href="GHC.Cmm.Dataflow.Block.html#O"><span class="hs-identifier hs-type">O</span></a></span><span> </span><span class="annot"><a href="GHC.Cmm.Dataflow.Block.html#C"><span class="hs-identifier hs-type">C</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Cmm.Node.html#CmmNode"><span class="hs-identifier hs-type">CmmNode</span></a></span><span> </span><span class="annot"><a href="GHC.Cmm.Dataflow.Block.html#O"><span class="hs-identifier hs-type">O</span></a></span><span> </span><span class="annot"><a href="GHC.Cmm.Dataflow.Block.html#C"><span class="hs-identifier hs-type">C</span></a></span><span>
</span><span id="line-401"></span><span>    </span><span id="local-6989586621681046614"><span class="annot"><span class="annottext">last :: CmmNode O C -&gt; CmmNode O C
</span><a href="#local-6989586621681046614"><span class="hs-identifier hs-var hs-var">last</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Cmm.Node.html#CmmBranch"><span class="hs-identifier hs-type">CmmBranch</span></a></span><span> </span><span id="local-6989586621681046611"><span class="annot"><span class="annottext">BlockId
</span><a href="#local-6989586621681046611"><span class="hs-identifier hs-var">id</span></a></span></span><span class="hs-special">)</span><span>          </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">BlockId -&gt; CmmNode O C
</span><a href="GHC.Cmm.Node.html#CmmBranch"><span class="hs-identifier hs-var">CmmBranch</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">BlockId -&gt; BlockId
</span><a href="#local-6989586621681046610"><span class="hs-identifier hs-var">lookup</span></a></span><span> </span><span class="annot"><span class="annottext">BlockId
</span><a href="#local-6989586621681046611"><span class="hs-identifier hs-var">id</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-402"></span><span>    </span><span class="annot"><a href="#local-6989586621681046614"><span class="hs-identifier hs-var">last</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Cmm.Node.html#CmmCondBranch"><span class="hs-identifier hs-type">CmmCondBranch</span></a></span><span> </span><span id="local-6989586621681046607"><span class="annot"><span class="annottext">CmmExpr
</span><a href="#local-6989586621681046607"><span class="hs-identifier hs-var">e</span></a></span></span><span> </span><span id="local-6989586621681046606"><span class="annot"><span class="annottext">BlockId
</span><a href="#local-6989586621681046606"><span class="hs-identifier hs-var">ti</span></a></span></span><span> </span><span id="local-6989586621681046605"><span class="annot"><span class="annottext">BlockId
</span><a href="#local-6989586621681046605"><span class="hs-identifier hs-var">fi</span></a></span></span><span> </span><span id="local-6989586621681046604"><span class="annot"><span class="annottext">Maybe Bool
</span><a href="#local-6989586621681046604"><span class="hs-identifier hs-var">l</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">CmmExpr -&gt; BlockId -&gt; BlockId -&gt; Maybe Bool -&gt; CmmNode O C
</span><a href="GHC.Cmm.Node.html#CmmCondBranch"><span class="hs-identifier hs-var">CmmCondBranch</span></a></span><span> </span><span class="annot"><span class="annottext">CmmExpr
</span><a href="#local-6989586621681046607"><span class="hs-identifier hs-var">e</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">BlockId -&gt; BlockId
</span><a href="#local-6989586621681046610"><span class="hs-identifier hs-var">lookup</span></a></span><span> </span><span class="annot"><span class="annottext">BlockId
</span><a href="#local-6989586621681046606"><span class="hs-identifier hs-var">ti</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">BlockId -&gt; BlockId
</span><a href="#local-6989586621681046610"><span class="hs-identifier hs-var">lookup</span></a></span><span> </span><span class="annot"><span class="annottext">BlockId
</span><a href="#local-6989586621681046605"><span class="hs-identifier hs-var">fi</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">Maybe Bool
</span><a href="#local-6989586621681046604"><span class="hs-identifier hs-var">l</span></a></span><span>
</span><span id="line-403"></span><span>    </span><span class="annot"><a href="#local-6989586621681046614"><span class="hs-identifier hs-var">last</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Cmm.Node.html#CmmSwitch"><span class="hs-identifier hs-type">CmmSwitch</span></a></span><span> </span><span id="local-6989586621681046601"><span class="annot"><span class="annottext">CmmExpr
</span><a href="#local-6989586621681046601"><span class="hs-identifier hs-var">e</span></a></span></span><span> </span><span id="local-6989586621681046600"><span class="annot"><span class="annottext">SwitchTargets
</span><a href="#local-6989586621681046600"><span class="hs-identifier hs-var">ids</span></a></span></span><span class="hs-special">)</span><span>       </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">CmmExpr -&gt; SwitchTargets -&gt; CmmNode O C
</span><a href="GHC.Cmm.Node.html#CmmSwitch"><span class="hs-identifier hs-var">CmmSwitch</span></a></span><span> </span><span class="annot"><span class="annottext">CmmExpr
</span><a href="#local-6989586621681046601"><span class="hs-identifier hs-var">e</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">(BlockId -&gt; BlockId) -&gt; SwitchTargets -&gt; SwitchTargets
</span><a href="GHC.Cmm.Switch.html#mapSwitchTargets"><span class="hs-identifier hs-var">mapSwitchTargets</span></a></span><span> </span><span class="annot"><span class="annottext">BlockId -&gt; BlockId
</span><a href="#local-6989586621681046610"><span class="hs-identifier hs-var">lookup</span></a></span><span> </span><span class="annot"><span class="annottext">SwitchTargets
</span><a href="#local-6989586621681046600"><span class="hs-identifier hs-var">ids</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-404"></span><span>    </span><span class="annot"><a href="#local-6989586621681046614"><span class="hs-identifier hs-var">last</span></a></span><span> </span><span id="local-6989586621681046598"><span class="annot"><span class="annottext">l :: CmmNode O C
</span><a href="#local-6989586621681046598"><span class="hs-identifier hs-var">l</span></a></span></span><span class="hs-glyph">@</span><span class="hs-special">(</span><span class="annot"><a href="GHC.Cmm.Node.html#CmmCall"><span class="hs-identifier hs-type">CmmCall</span></a></span><span> </span><span class="hs-special">{</span><span class="hs-special">}</span><span class="hs-special">)</span><span>          </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">CmmNode O C
</span><a href="#local-6989586621681046598"><span class="hs-identifier hs-var">l</span></a></span><span> </span><span class="hs-special">{</span><span> </span><span class="annot"><span class="annottext">cml_cont :: Maybe BlockId
</span><a href="GHC.Cmm.Node.html#cml_cont"><span class="hs-identifier hs-var">cml_cont</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Maybe BlockId
forall a. Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Nothing"><span class="hs-identifier hs-var">Nothing</span></a></span><span> </span><span class="hs-special">}</span><span>
</span><span id="line-405"></span><span>            </span><span class="hs-comment">-- NB. remove the continuation of a CmmCall, since this</span><span>
</span><span id="line-406"></span><span>            </span><span class="hs-comment">-- label will now be in a different CmmProc.  Not only</span><span>
</span><span id="line-407"></span><span>            </span><span class="hs-comment">-- is this tidier, it stops CmmLint from complaining.</span><span>
</span><span id="line-408"></span><span>    </span><span class="annot"><a href="#local-6989586621681046614"><span class="hs-identifier hs-var">last</span></a></span><span> </span><span id="local-6989586621681046595"><span class="annot"><span class="annottext">l :: CmmNode O C
</span><a href="#local-6989586621681046595"><span class="hs-identifier hs-var">l</span></a></span></span><span class="hs-glyph">@</span><span class="hs-special">(</span><span class="annot"><a href="GHC.Cmm.Node.html#CmmForeignCall"><span class="hs-identifier hs-type">CmmForeignCall</span></a></span><span> </span><span class="hs-special">{</span><span class="hs-special">}</span><span class="hs-special">)</span><span>   </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">CmmNode O C
</span><a href="#local-6989586621681046595"><span class="hs-identifier hs-var">l</span></a></span><span>
</span><span id="line-409"></span><span>    </span><span id="local-6989586621681046610"><span class="annot"><span class="annottext">lookup :: BlockId -&gt; BlockId
</span><a href="#local-6989586621681046610"><span class="hs-identifier hs-var hs-var">lookup</span></a></span></span><span> </span><span id="local-6989586621681046592"><span class="annot"><span class="annottext">BlockId
</span><a href="#local-6989586621681046592"><span class="hs-identifier hs-var">id</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(BlockId -&gt; BlockId) -&gt; Maybe BlockId -&gt; Maybe BlockId
forall (f :: * -&gt; *) a b. Functor f =&gt; (a -&gt; b) -&gt; f a -&gt; f b
</span><a href="../../base/src/GHC.Base.html#fmap"><span class="hs-identifier hs-var">fmap</span></a></span><span> </span><span class="annot"><span class="annottext">BlockId -&gt; BlockId
</span><a href="#local-6989586621681046610"><span class="hs-identifier hs-var">lookup</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">KeyOf LabelMap -&gt; LabelMap BlockId -&gt; Maybe BlockId
forall (map :: * -&gt; *) a.
IsMap map =&gt;
KeyOf map -&gt; map a -&gt; Maybe a
</span><a href="GHC.Cmm.Dataflow.Collections.html#mapLookup"><span class="hs-identifier hs-var">mapLookup</span></a></span><span> </span><span class="annot"><span class="annottext">KeyOf LabelMap
BlockId
</span><a href="#local-6989586621681046592"><span class="hs-identifier hs-var">id</span></a></span><span> </span><span class="annot"><span class="annottext">LabelMap BlockId
</span><a href="#local-6989586621681046620"><span class="hs-identifier hs-var">env</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">Maybe BlockId -&gt; BlockId -&gt; BlockId
forall a. Maybe a -&gt; a -&gt; a
</span><a href="GHC.Data.Maybe.html#orElse"><span class="hs-operator hs-var">`orElse`</span></a></span><span> </span><span class="annot"><span class="annottext">BlockId
</span><a href="#local-6989586621681046592"><span class="hs-identifier hs-var">id</span></a></span><span>
</span><span id="line-410"></span><span>            </span><span class="hs-comment">-- XXX: this is a recursive lookup, it follows chains</span><span>
</span><span id="line-411"></span><span>            </span><span class="hs-comment">-- until the lookup returns Nothing, at which point we</span><span>
</span><span id="line-412"></span><span>            </span><span class="hs-comment">-- return the last BlockId</span><span>
</span><span id="line-413"></span><span>
</span><span id="line-414"></span><span class="hs-comment">-- --------------------------------------------------------------</span><span>
</span><span id="line-415"></span><span class="hs-comment">-- Not splitting proc points: add info tables for continuations</span><span>
</span><span id="line-416"></span><span>
</span><span id="line-417"></span><span class="annot"><a href="GHC.Cmm.ProcPoint.html#attachContInfoTables"><span class="hs-identifier hs-type">attachContInfoTables</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Cmm.ProcPoint.html#ProcPointSet"><span class="hs-identifier hs-type">ProcPointSet</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Cmm.html#CmmDecl"><span class="hs-identifier hs-type">CmmDecl</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Cmm.html#CmmDecl"><span class="hs-identifier hs-type">CmmDecl</span></a></span><span>
</span><span id="line-418"></span><span id="attachContInfoTables"><span class="annot"><span class="annottext">attachContInfoTables :: ProcPointSet -&gt; CmmDecl -&gt; CmmDecl
</span><a href="GHC.Cmm.ProcPoint.html#attachContInfoTables"><span class="hs-identifier hs-var hs-var">attachContInfoTables</span></a></span></span><span> </span><span id="local-6989586621681046591"><span class="annot"><span class="annottext">ProcPointSet
</span><a href="#local-6989586621681046591"><span class="hs-identifier hs-var">call_proc_points</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Cmm.html#CmmProc"><span class="hs-identifier hs-type">CmmProc</span></a></span><span> </span><span id="local-6989586621681046590"><span class="annot"><span class="annottext">CmmTopInfo
</span><a href="#local-6989586621681046590"><span class="hs-identifier hs-var">top_info</span></a></span></span><span> </span><span id="local-6989586621681046589"><span class="annot"><span class="annottext">CLabel
</span><a href="#local-6989586621681046589"><span class="hs-identifier hs-var">top_l</span></a></span></span><span> </span><span id="local-6989586621681046588"><span class="annot"><span class="annottext">[GlobalReg]
</span><a href="#local-6989586621681046588"><span class="hs-identifier hs-var">live</span></a></span></span><span> </span><span id="local-6989586621681046587"><span class="annot"><span class="annottext">CmmGraph
</span><a href="#local-6989586621681046587"><span class="hs-identifier hs-var">g</span></a></span></span><span class="hs-special">)</span><span>
</span><span id="line-419"></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">CmmTopInfo -&gt; CLabel -&gt; [GlobalReg] -&gt; CmmGraph -&gt; CmmDecl
forall d h g. h -&gt; CLabel -&gt; [GlobalReg] -&gt; g -&gt; GenCmmDecl d h g
</span><a href="GHC.Cmm.html#CmmProc"><span class="hs-identifier hs-var">CmmProc</span></a></span><span> </span><span class="annot"><span class="annottext">CmmTopInfo
</span><a href="#local-6989586621681046590"><span class="hs-identifier hs-var">top_info</span></a></span><span class="hs-special">{</span><span class="annot"><span class="annottext">info_tbls :: LabelMap CmmInfoTable
</span><a href="GHC.Cmm.html#info_tbls"><span class="hs-identifier hs-var">info_tbls</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">LabelMap CmmInfoTable
</span><a href="#local-6989586621681046586"><span class="hs-identifier hs-var">info_tbls'</span></a></span><span class="hs-special">}</span><span> </span><span class="annot"><span class="annottext">CLabel
</span><a href="#local-6989586621681046589"><span class="hs-identifier hs-var">top_l</span></a></span><span> </span><span class="annot"><span class="annottext">[GlobalReg]
</span><a href="#local-6989586621681046588"><span class="hs-identifier hs-var">live</span></a></span><span> </span><span class="annot"><span class="annottext">CmmGraph
</span><a href="#local-6989586621681046587"><span class="hs-identifier hs-var">g</span></a></span><span>
</span><span id="line-420"></span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-421"></span><span>   </span><span id="local-6989586621681046586"><span class="annot"><span class="annottext">info_tbls' :: LabelMap CmmInfoTable
</span><a href="#local-6989586621681046586"><span class="hs-identifier hs-var hs-var">info_tbls'</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">LabelMap CmmInfoTable
-&gt; LabelMap CmmInfoTable -&gt; LabelMap CmmInfoTable
forall (map :: * -&gt; *) a. IsMap map =&gt; map a -&gt; map a -&gt; map a
</span><a href="GHC.Cmm.Dataflow.Collections.html#mapUnion"><span class="hs-identifier hs-var">mapUnion</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">CmmTopInfo -&gt; LabelMap CmmInfoTable
</span><a href="GHC.Cmm.html#info_tbls"><span class="hs-identifier hs-var hs-var">info_tbls</span></a></span><span> </span><span class="annot"><span class="annottext">CmmTopInfo
</span><a href="#local-6989586621681046590"><span class="hs-identifier hs-var">top_info</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">(LabelMap CmmInfoTable -&gt; LabelMap CmmInfoTable)
-&gt; LabelMap CmmInfoTable -&gt; LabelMap CmmInfoTable
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span>
</span><span id="line-422"></span><span>                </span><span class="annot"><span class="annottext">[(KeyOf LabelMap, CmmInfoTable)] -&gt; LabelMap CmmInfoTable
forall (map :: * -&gt; *) a. IsMap map =&gt; [(KeyOf map, a)] -&gt; map a
</span><a href="GHC.Cmm.Dataflow.Collections.html#mapFromList"><span class="hs-identifier hs-var">mapFromList</span></a></span><span> </span><span class="hs-special">[</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">KeyOf LabelMap
BlockId
</span><a href="#local-6989586621681046583"><span class="hs-identifier hs-var">l</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">CLabel -&gt; CmmInfoTable
</span><a href="GHC.Cmm.Info.html#mkEmptyContInfoTable"><span class="hs-identifier hs-var">mkEmptyContInfoTable</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">BlockId -&gt; CLabel
</span><a href="GHC.Cmm.BlockId.html#infoTblLbl"><span class="hs-identifier hs-var">infoTblLbl</span></a></span><span> </span><span class="annot"><span class="annottext">BlockId
</span><a href="#local-6989586621681046583"><span class="hs-identifier hs-var">l</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-423"></span><span>                            </span><span class="hs-glyph">|</span><span> </span><span id="local-6989586621681046583"><span class="annot"><span class="annottext">BlockId
</span><a href="#local-6989586621681046583"><span class="hs-identifier hs-var">l</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">ProcPointSet -&gt; [ElemOf ProcPointSet]
forall set. IsSet set =&gt; set -&gt; [ElemOf set]
</span><a href="GHC.Cmm.Dataflow.Collections.html#setElems"><span class="hs-identifier hs-var">setElems</span></a></span><span> </span><span class="annot"><span class="annottext">ProcPointSet
</span><a href="#local-6989586621681046591"><span class="hs-identifier hs-var">call_proc_points</span></a></span><span>
</span><span id="line-424"></span><span>                            </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">BlockId
</span><a href="#local-6989586621681046583"><span class="hs-identifier hs-var">l</span></a></span><span> </span><span class="annot"><span class="annottext">BlockId -&gt; BlockId -&gt; Bool
forall a. Eq a =&gt; a -&gt; a -&gt; Bool
</span><span class="hs-operator hs-var">/=</span></span><span> </span><span class="annot"><span class="annottext">CmmGraph -&gt; BlockId
forall (n :: Extensibility -&gt; Extensibility -&gt; *).
GenCmmGraph n -&gt; BlockId
</span><a href="GHC.Cmm.html#g_entry"><span class="hs-identifier hs-var hs-var">g_entry</span></a></span><span> </span><span class="annot"><span class="annottext">CmmGraph
</span><a href="#local-6989586621681046587"><span class="hs-identifier hs-var">g</span></a></span><span> </span><span class="hs-special">]</span><span>
</span><span id="line-425"></span><span class="annot"><a href="GHC.Cmm.ProcPoint.html#attachContInfoTables"><span class="hs-identifier hs-var">attachContInfoTables</span></a></span><span> </span><span class="annot"><span class="annottext">ProcPointSet
</span><span class="hs-identifier">_</span></span><span> </span><span id="local-6989586621681046581"><span class="annot"><span class="annottext">CmmDecl
</span><a href="#local-6989586621681046581"><span class="hs-identifier hs-var">other_decl</span></a></span></span><span>
</span><span id="line-426"></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">CmmDecl
</span><a href="#local-6989586621681046581"><span class="hs-identifier hs-var">other_decl</span></a></span><span>
</span><span id="line-427"></span><span>
</span><span id="line-428"></span><span class="hs-comment">----------------------------------------------------------------</span><span>
</span><span id="line-429"></span><span>
</span><span id="line-430"></span><span class="hs-comment">{-
Note [Direct reachability]

Block B is directly reachable from proc point P iff control can flow
from P to B without passing through an intervening proc point.
-}</span><span>
</span><span id="line-436"></span><span>
</span><span id="line-437"></span><span class="hs-comment">----------------------------------------------------------------</span><span>
</span><span id="line-438"></span><span>
</span><span id="line-439"></span><span class="hs-comment">{-
Note [No simple dataflow]

Sadly, it seems impossible to compute the proc points using a single
dataflow pass.  One might attempt to use this simple lattice:

  data Location = Unknown
                | InProc BlockId -- node is in procedure headed by the named proc point
                | ProcPoint      -- node is itself a proc point

At a join, a node in two different blocks becomes a proc point.
The difficulty is that the change of information during iterative
computation may promote a node prematurely.  Here's a program that
illustrates the difficulty:

  f () {
  entry:
    ....
  L1:
    if (...) { ... }
    else { ... }

  L2: if (...) { g(); goto L1; }
      return x + y;
  }

The only proc-point needed (besides the entry) is L1.  But in an
iterative analysis, consider what happens to L2.  On the first pass
through, it rises from Unknown to 'InProc entry', but when L1 is
promoted to a proc point (because it's the successor of g()), L1's
successors will be promoted to 'InProc L1'.  The problem hits when the
new fact 'InProc L1' flows into L2 which is already bound to 'InProc entry'.
The join operation makes it a proc point when in fact it needn't be,
because its immediate dominator L1 is already a proc point and there
are no other proc points that directly reach L2.
-}</span><span>
</span><span id="line-475"></span><span>
</span><span id="line-476"></span><span>
</span><span id="line-477"></span><span>
</span><span id="line-478"></span><span class="hs-comment">{- Note [Separate Adams optimization]
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
It may be worthwhile to attempt the Adams optimization by rewriting
the graph before the assignment of proc-point protocols.  Here are a
couple of rules:

  g() returns to k;                    g() returns to L;
  k: CopyIn c ress; goto L:
   ...                        ==&gt;        ...
  L: // no CopyIn node here            L: CopyIn c ress;


And when c == c' and ress == ress', this also:

  g() returns to k;                    g() returns to L;
  k: CopyIn c ress; goto L:
   ...                        ==&gt;        ...
  L: CopyIn c' ress'                   L: CopyIn c' ress' ;

In both cases the goal is to eliminate k.
-}</span><span>
</span><span id="line-499"></span></pre></body></html>